verifies that the resources are set onto each job vertex correctly when generating job graph which covers the delta iteration case

public void test resources for delta iteration ( ) throws exception { resource spec resource 1 = resource spec new builder ( 0 1 , 100 ) build ( ) ; resource spec resource 2 = resource spec new builder ( 0 2 , 200 ) build ( ) ; resource spec resource 3 = resource spec new builder ( 0 3 , 300 ) build ( ) ; resource spec resource 4 = resource spec new builder ( 0 4 , 400 ) build ( ) ; resource spec resource 5 = resource spec new builder ( 0 5 , 500 ) build ( ) ; resource spec resource 6 = resource spec new builder ( 0 6 , 600 ) build ( ) ; method op method = operator class get declared method ( " set resources " , resource spec class ) ; op method set accessible ( true ) ; method delta method = delta iteration class get declared method ( " set resources " , resource spec class ) ; delta method set accessible ( true ) ; method sink method = data sink class get declared method ( " set resources " , resource spec class ) ; sink method set accessible ( true ) ; map function < tuple 2 < long , long > , tuple 2 < long , long > > map function = new map function < tuple 2 < long , long > , tuple 2 < long , long > > ( ) { @ override public tuple 2 < long , long > map ( tuple 2 < long , long > value ) throws exception { return value ; } } ; filter function < tuple 2 < long , long > > filter function = new filter function < tuple 2 < long , long > > ( ) { @ override public boolean filter ( tuple 2 < long , long > value ) throws exception { return false ; } } ; execution environment env = execution environment get execution environment ( ) ; data set < tuple 2 < long , long > > input = env from elements ( new tuple 2 < > ( 1l , 2l ) ) ; op method invoke ( input , resource 1 ) ; / / chain ( map - > filter ) data set < tuple 2 < long , long > > map = input map ( map function ) ; op method invoke ( map , resource 2 ) ; delta iteration < tuple 2 < long , long > , tuple 2 < long , long > > iteration = map iterate delta ( map , 100 , 0 ) register aggregator ( " test " , new long sum aggregator ( ) ) ; delta method invoke ( iteration , resource 3 ) ; data set < tuple 2 < long , long > > delta = iteration get workset ( ) map ( map function ) ; op method invoke ( delta , resource 4 ) ; data set < tuple 2 < long , long > > feedback = delta filter ( filter function ) ; op method invoke ( feedback , resource 5 ) ; data sink < tuple 2 < long , long > > sink = iteration close with ( delta , feedback ) output ( new discarding output format < tuple 2 < long , long > > ( ) ) ; sink method invoke ( sink , resource 6 ) ; job graph job graph = compile job ( env ) ; job vertex source map vertex = job graph get vertices sorted topologically from sources ( ) get ( 0 ) ; job vertex iteration head vertex = job graph get vertices sorted topologically from sources ( ) get ( 1 ) ; job vertex delta vertex = job graph get vertices sorted topologically from sources ( ) get ( 2 ) ; job vertex iteration tail vertex = job graph get vertices sorted topologically from sources ( ) get ( 3 ) ; job vertex feedback vertex = job graph get vertices sorted topologically from sources ( ) get ( 4 ) ; job vertex sink vertex = job graph get vertices sorted topologically from sources ( ) get ( 5 ) ; job vertex iteration sync vertex = job graph get vertices sorted topologically from sources ( ) get ( 6 ) ; assert true ( source map vertex get min resources ( ) equals ( resource 1 merge ( resource 2 ) ) ) ; assert true ( iteration head vertex get preferred resources ( ) equals ( resource 3 ) ) ; assert true ( delta vertex get min resources ( ) equals ( resource 4 ) ) ; / / the iteration tail task will be scheduled in the same instance with iteration head , and / / currently not set resources assert true ( iteration tail vertex get preferred resources ( ) equals ( resource spec default ) ) ; assert true ( feedback vertex get min resources ( ) equals ( resource 5 ) ) ; assert true ( sink vertex get preferred resources ( ) equals ( resource 6 ) ) ; assert true ( iteration sync vertex get min resources ( ) equals ( resource 3 ) ) ; }


returns the value of the request header " user - agent " as a < code > string < code >

public static string get user agent ( http servlet request request ) { string user agent = request get header ( http header consts user agent header ) ; if ( string utils is empty ( user agent ) ) { user agent = string utils default if empty ( request get header ( http header consts client version header ) , string utils empty ) ; } return user agent ; }


a timeout value in case the master has not been discovered yet or disconnected

public final request master node timeout ( time value timeout ) { this master node timeout = timeout ; return ( request ) this ; }


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


public void test has only read only ( ) { / / todo : test has only read only }


protected void add ticket to registry ( final ticket ticket , final ticket granting ticket ticket granting ticket ) { logger debug ( " adding ticket [ { } ] to registry " , ticket ) ; this central authentication service add ticket ( ticket ) ; if ( ticket granting ticket ! = null ) { logger debug ( " updating parent ticket - granting ticket [ { } ] " , ticket granting ticket ) ; this central authentication service update ticket ( ticket granting ticket ) ; } }


returns whether this integer value is less than or equal to the given unknown integer value : < code > never < code > , < code > maybe < code > , or < code > always < code >

public int less than or equal ( unknown integer value other ) { return less than or equal ( ( integer value ) other ) ; }


unpack the data in a packed section calling this method is only valid on a packed section

public byte [ ] get unpacked data ( task monitor monitor ) throws i o exception { if ( get section kind ( ) ! = section kind packed data ) { throw new i o exception ( " attempt to unpack a section that is not packed " ) ; } try ( input stream input = get data ( ) ) { byte [ ] data = new byte [ get unpacked length ( ) ] ; int index = 0 ; while ( index < data length ) { if ( monitor is cancelled ( ) ) { break ; } int value = input read ( ) ; if ( value = = - 1 ) { throw new illegal state exception ( ) ; } int count = value & 0x 1f ; / / count is the lower 5 bits if ( count = = 0 ) { count = unpack next value ( input ) ; } packed data opcodes opcode = packed data opcodes get ( value > > 5 ) ; if ( opcode = = packed data opcodes k p e f pk data zero ) { index + = count ; } else if ( opcode = = packed data opcodes k p e f pk data block ) { byte [ ] raw data = new byte [ count ] ; int n read = input read ( raw data ) ; if ( n read ! = count ) { throw new illegal state exception ( " unable to read enough bytes for " + opcode ) ; } system arraycopy ( raw data , 0 , data , index , raw data length ) ; index + = raw data length ; } else if ( opcode = = packed data opcodes k p e f pk data repeat ) { int repeat count = unpack next value ( input ) ; byte [ ] raw data = new byte [ count ] ; int n read = input read ( raw data ) ; if ( n read ! = raw data length ) { throw new illegal state exception ( " unable to read enough bytes for " + opcode ) ; } for ( int i = 0 ; i < repeat count - 1 ; + + i ) { system arraycopy ( raw data , 0 , data , index , raw data length ) ; index + = raw data length ; } } else if ( opcode = = packed data opcodes k p e f pk data repeat block ) { int common size = count ; int custom size = unpack next value ( input ) ; int repeat count = unpack next value ( input ) ; byte [ ] common data = new byte [ common size ] ; int n common read = input read ( common data ) ; if ( n common read ! = common data length ) { throw new illegal state exception ( " unable to read enough common data bytes for " + opcode ) ; } for ( int i = 0 ; i < repeat count ; + + i ) { system arraycopy ( common data , 0 , data , index , common data length ) ; index + = common data length ; byte [ ] custom data = new byte [ custom size ] ; int n custom read = input read ( custom data ) ; if ( n custom read ! = custom data length ) { throw new illegal state exception ( " unable to read enough custom data bytes for " + opcode ) ; } system arraycopy ( custom data , 0 , data , index , custom data length ) ; index + = custom data length ; } / / a final common data pattern is added at end system arraycopy ( common data , 0 , data , index , common data length ) ; index + = common data length ; } else if ( opcode = = packed data opcodes k p e f pk data repeat zero ) { int common size = count ; int custom size = unpack next value ( input ) ; int repeat count = unpack next value ( input ) ; for ( int i = 0 ; i < repeat count ; + + i ) { index + = common size ; / / skip common size of zero bytes byte [ ] custom data = new byte [ custom size ] ; int n custom read = input read ( custom data ) ; if ( n custom read ! = custom data length ) { throw new illegal state exception ( " unable to read enough custom data bytes for " + opcode ) ; } system arraycopy ( custom data , 0 , data , index , custom data length ) ; index + = custom data length ; } index + = common size ; / / a final common size of zero bytes } else { msg error ( this , " unrecognized packed data opcode : " + opcode ) ; } } return data ; } }


enter a parse tree produced by { @ link eql base parser # query }

void enter query ( eql base parser query context ctx ) ;


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


returns the general purpose bit flags of the entry see < a href = " http : www pkware comdocumentscasestudies a p p n o t e txt " > zip format section 4 4 4

public short get flags ( ) { return flags ; }


add all extension specific dynamic table entry types ( e g , dt prefix ) this method will add all those statically defined elf dynamic type fields within this class

public final void add dynamic types ( map < integer , elf dynamic type > dynamic type map ) { for ( field field : get class ( ) get declared fields ( ) ) { string name = null ; try { if ( modifier is static ( field get modifiers ( ) ) & & field get type ( ) equals ( elf dynamic type class ) ) { elf dynamic type type = ( elf dynamic type ) field get ( this ) ; name = type name ; elf dynamic type add dynamic type ( type , dynamic type map ) ; } } catch ( duplicate name exception e ) { msg error ( this , " invalid elf dynamic type ( " + name + " ) defined by " + get class ( ) get name ( ) , e ) ; } catch ( illegal argument exception | illegal access exception e ) { throw new assert exception ( e ) ; } } }


set the < code > relax locality < code > of the request

public resource request builder relax locality ( boolean relax locality ) { resource request set relax locality ( relax locality ) ; return this ; }


verify handling of inconsistent peer type

public void test inconsistent peer type ( ) throws exception { client base setup test env ( ) ; / / setup the logger to capture all logs byte array output stream os = new byte array output stream ( ) ; writer appender appender = get console appender ( os , level info ) ; logger qlogger = logger get logger ( " org apache zookeeper server quorum " ) ; qlogger add appender ( appender ) ; / / test the most likely situation only : server is stated as observer in / / servers list , but there ' s no " peer type = observer " token in config try { final int client port qp1 = port assignment unique ( ) ; final int client port qp2 = port assignment unique ( ) ; final int client port qp3 = port assignment unique ( ) ; string quorum cfg section = " server 1 = 127 0 0 1 : " + port assignment unique ( ) + " : " + port assignment unique ( ) + " ; " + client port qp1 + " \ nserver 2 = 127 0 0 1 : " + port assignment unique ( ) + " : " + port assignment unique ( ) + " ; " + client port qp2 + " \ nserver 3 = 127 0 0 1 : " + port assignment unique ( ) + " : " + port assignment unique ( ) + " : observer " + " ; " + client port qp3 ; main thread q 1 = new main thread ( 1 , client port qp1 , quorum cfg section ) ; main thread q 2 = new main thread ( 2 , client port qp2 , quorum cfg section ) ; main thread q 3 = new main thread ( 3 , client port qp3 , quorum cfg section ) ; q 1 start ( ) ; q 2 start ( ) ; q 3 start ( ) ; assert true ( client base wait for server up ( " 127 0 0 1 : " + client port qp1 , connection timeout ) , " waiting for server 1 being up " ) ; assert true ( client base wait for server up ( " 127 0 0 1 : " + client port qp2 , connection timeout ) , " waiting for server 2 being up " ) ; assert true ( client base wait for server up ( " 127 0 0 1 : " + client port qp3 , connection timeout ) , " waiting for server 3 being up " ) ; q 1 shutdown ( ) ; q 2 shutdown ( ) ; q 3 shutdown ( ) ; assert true ( client base wait for server down ( " 127 0 0 1 : " + client port qp1 , client base connection timeout ) , " waiting for server 1 down " ) ; assert true ( client base wait for server down ( " 127 0 0 1 : " + client port qp2 , client base connection timeout ) , " waiting for server 2 down " ) ; assert true ( client base wait for server down ( " 127 0 0 1 : " + client port qp3 , client base connection timeout ) , " waiting for server 3 down " ) ; } finally { qlogger remove appender ( appender ) ; } line number reader r = new line number reader ( new string reader ( os to string ( ) ) ) ; string line ; boolean warning present = false ; boolean defaulted to observer = false ; pattern p warn = pattern compile ( " * peer type from servers list * doesn ' t match peer type * " ) ; pattern p observe = pattern compile ( " * observing * " ) ; while ( ( line = r read line ( ) ) ! = null ) { if ( p warn matcher ( line ) matches ( ) ) { warning present = true ; } if ( p observe matcher ( line ) matches ( ) ) { defaulted to observer = true ; } if ( warning present & & defaulted to observer ) { break ; } } assert true ( warning present & & defaulted to observer , " should warn about inconsistent peer type " ) ; }


public int next ( ) { switch ( n ) { case 0 : return - 1 ; case 1 : { int index = mapping get ( 0 ) ; - - n ; return index ; } default : { int pos = rand next int ( n ) ; int index = mapping get ( pos ) ; mapping swap ( pos , - - n ) ; return index ; } } }


returns the index to the start of the segment table , relative to the beginning of the file

int get non resident name table offset ( ) { return ne nrestab ; }


called every time an item has been parsedresolved

void on item completed ( string item name ) ;


a callback that should never be invoked directly

public synchronized void on resource ready ( @ non null r resource , @ nullable transition < ? super r > transition ) { / / ignored , synchronized for backwards compatibility }


name the junit thread for the class this will overridden before the individual test methods are run

public static void name test thread ( ) { thread current thread ( ) set name ( " j unit " ) ; }


sets the < code > last name < code > property

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


exit a parse tree produced by the { @ code null literal } labeled alternative in { @ link eql base parser # constant }

void exit null literal ( eql base parser null literal context ctx ) ;


returns the y screen location of the popup point


returns the appropriate member visitor , depending on whether the given method is an initializer or not

private member visitor applicable member visitor ( clazz clazz , member method ) { return class util is initializer ( method get name ( clazz ) ) ? initializer member visitor : other member visitor ; }


convenience method for { @ link # add listener ( job tracker job filter , job tracker job listener ) } that takes in an id to filter on

public void add listener ( @ non null string id , @ non null job tracker job listener listener ) { job tracker add listener ( new job id filter ( id ) , listener ) ; }


finds a table factory of the given class and property map this method enables disambiguating multiple matching { @ link component factory } s based on additional optional context provided via { @ link component factory # optional context ( ) }

public static < t extends component factory > t find ( class < t > factory class , map < string , string > property map ) { list < t > all = table factory service find all ( factory class , property map ) ; list < t > filtered = all stream ( ) filter ( factory - > { map < string , string > optional context = factory optional context ( ) ; return optional context entry set ( ) stream ( ) all match ( entry - > { string property = property map get ( entry get key ( ) ) ; if ( property ! = null ) { return property equals ( entry get value ( ) ) ; } else { return true ; } } ) ; } ) collect ( collectors to list ( ) ) ; if ( filtered size ( ) > 1 ) { throw new ambiguous table factory exception ( filtered , factory class , new array list < > ( all ) , property map ) ; } else if ( filtered is empty ( ) ) { throw new no matching table factory exception ( " no factory supports the additional filters " , factory class , new array list < > ( all ) , property map ) ; } else { return filtered get ( 0 ) ; } }


set the map input data compression ratio in the given conf

static void set map input compression emulation ratio ( configuration conf , float ratio ) { conf set float ( gridmix map input compression ratio , ratio ) ; }


public document db mapping context create document db mapping context ( ) { val document db mapping context = new document db mapping context ( ) ; document db mapping context set initial entity set ( new entity scanner ( application context ) scan ( persistent class ) ) ; return document db mapping context ; }


test that deep stubbing works for one intermediate level

public void one level deep ( ) throws exception { output stream out = new byte array output stream ( ) ; socket factory socket factory = mock ( socket factory class , returns deep stubs ) ; when ( socket factory create socket ( ) get output stream ( ) ) then return ( out ) ; assert same ( out , socket factory create socket ( ) get output stream ( ) ) ; }


method to check initial value of the statistics which should be 0

private void check initial value ( string stat name , long stat value ) { assert equals ( " mismatch in " + stat name , 0 , stat value ) ; }


registers a members injector for type { @ code i } guice will use the members injector after its performed its own injections on an instance of { @ code i }

void register ( members injector < ? super i > members injector ) ;


the resource id ( 0x p p t t e e e e ) of the resource being referred < code > optional uint 3 2 id = 2 ; < code >

public builder clear id ( ) { copy on write ( ) ; instance clear id ( ) ; return this ; }


whether the response received from was the result of some type of failure and < code > get fallback ( ) < code > being called

public boolean is response from fallback ( ) { return get command result ( ) get event counts ( ) contains ( hystrix event type fallback success ) ; }


locates a given field anywhere in the class inheritance hierarchy

private static field find field ( object instance , string name ) throws no such field exception { for ( class < ? > clazz = instance get class ( ) ; clazz ! = null ; clazz = clazz get superclass ( ) ) { try { field field = clazz get declared field ( name ) ; if ( ! field is accessible ( ) ) { field set accessible ( true ) ; } return field ; } catch ( no such field exception e ) { / / ignore and search next } } throw new no such field exception ( " field " + name + " not found in " + instance get class ( ) ) ; }


public map < string , boolean > get map boolean ( ) { return map boolean ; }


process the specified { @ link application event } , checking if the condition matches and handling a non - null result , if any

public void process event ( application event event ) { object [ ] args = resolve arguments ( event ) ; if ( should handle ( event , args ) ) { object result = do invoke ( args ) ; if ( result ! = null ) { handle result ( result ) ; } else { logger trace ( " no result object given - no result to handle " ) ; } } }


{ @ link com alibaba nacos core code spring application run listener # failed }

void failed ( configurable application context context , throwable exception ) ;


creates a throwable whose stack trace is based upon the current call stack , with any information coming before , and including , the given classes removed this method can take multiple classes , but you really only need to pass the oldest class of disinterest

public static throwable create throwable with stack older than ( class < ? > classes ) { list < string > to find = arrays stream ( classes ) map ( c - > c get name ( ) ) collect ( collectors to list ( ) ) ; if ( to find is empty ( ) ) { / / always ignore our class we get this for free if the client passes in any / / classes to find add ( 0 , reflection utilities class get name ( ) ) ; } throwable t = new throwable ( ) ; stack trace element [ ] trace = t get stack trace ( ) ; int last ignore index = - 1 ; for ( int i = 0 ; i < trace length ; i + + ) { stack trace element element = trace [ i ] ; string class name = element get class name ( ) ; int name index = to find index of ( class name ) ; if ( name index ! = - 1 ) { last ignore index = i ; } else { / / not a class of interest ; if we have already seen our muse , then we are done if ( last ignore index ! = - 1 ) { break ; } } } if ( last ignore index = = - 1 ) { throw new assert exception ( " did not find the following classes in the call stack : " + arrays to string ( classes ) ) ; } if ( last ignore index = = trace length - 1 ) { throw new assert exception ( " call stack only contains the classes to ignore : " + arrays to string ( classes ) ) ; } int start index = last ignore index + 1 ; stack trace element [ ] updated trace = arrays copy of range ( trace , start index , trace length ) ; t set stack trace ( updated trace ) ; return t ; }


similar to { @ link # test consistent list status after put ( ) } , this tests that the fs list located status ( ) call will return consistent list

public void test consistent list located status after put ( ) throws exception { final s 3 a file system fs = get file system ( ) ; string root dir = " do test consistent list located status after put " ; fs mkdirs ( path ( root dir ) ) ; final int [ ] num of paths = { 0 , 1 , 5 } ; for ( int normal path num : num of paths ) { for ( int delayed path num : new int [ ] { 0 , 2 } ) { log info ( " testing with normal path num = { } , delayed path num = { } " , normal path num , delayed path num ) ; do test consistent list located status after put ( fs , root dir , normal path num , delayed path num ) ; } } }


exchange the given request for a response mono

mono < client response > exchange ( client request request ) ;


check if this instruction has strange references we shouldn ' t mess with

private boolean has strange references ( instruction instr ) { if ( instr get flow override ( ) ! = flow override none ) { return true ; } / / should only have a call , and maybe some data references from param refs boolean had call = false ; reference [ ] references from = instr get references from ( ) ; for ( reference reference : references from ) { ref type reference type = reference get reference type ( ) ; if ( had call = = false & & reference type is call ( ) ) { had call = true ; continue ; } if ( reference type is data ( ) ) { continue ; } return true ; } boolean has indirect = false ; for ( int i = 0 ; i < references from length ; i + + ) { if ( references from [ i ] get reference type ( ) is indirect ( ) ) { has indirect = true ; } } if ( has indirect ) { return true ; } / / there must be another way to get to any instruction below this instruction next instr = instr get next ( ) ; if ( next instr = = null ) { return false ; } if ( ! instr get fall through ( ) equals ( next instr get min address ( ) ) ) { return false ; } reference iterator reference iterator to = next instr get reference iterator to ( ) ; while ( reference iterator to has next ( ) ) { reference reference = reference iterator to next ( ) ; / / found a reference other than this one if ( reference get from address ( ) ! = instr get min address ( ) ) { return false ; } } return true ; }


returns a map view that associates each key with the corresponding values in the multimap changes to the returned map , such as element removal , will update the underlying multimap the map does not support { @ code set value } on its entries , { @ code put } , or { @ code put all } when passed a key that is present in the map , { @ code as map ( ) get ( object ) } has the same behavior as { @ link # get } , returning a live collection when passed a key that is not present , however , { @ code as map ( ) get ( object ) } returns { @ code null } instead of an empty collection though the method signature doesn ' t say so explicitly , the returned map has { @ link sorted set } values

public map < k , collection < v > > as map ( ) { return super as map ( ) ; }


returns a new resource set with the provided values for memory mb and cpu usage , and with 0 0 for io usage and local test count use this method in action resource definitions when they aren ' t local tests

public static resource set create with ram cpu ( double memory mb , double cpu usage ) { if ( memory mb = = 0 & & cpu usage = = 0 ) { return zero ; } return new resource set ( memory mb , cpu usage , 0 ) ; }


add a link element implementation should try to figure out type by the suffix of href so < code > link ( " style css " ) ; < code > is a shortcut of < code > link ( ) $ rel ( " stylesheet " ) $ type ( " textcss " ) $ href ( " style css " ) ( ) ; < code >


recompute the display location and move with list window this is useful , e g , when the window containing the associated text field ( s ) moves

public void update display location ( ) { swing utilities invoke later ( ( ) - > { do update display location ( ) ; } ) ; }


returns a shallow copy of the tuple with swapped values


gets the shutdown hook thread if it exists

thread get shutdown hook thread ( ) { return shutdown hook thread ; }


start a transfer - manager managed async put of an object , incrementing the put requests and put bytes counters it does not update the other counters , as existing code does that as progress callbacks come in byte length is calculated from the file length , or , if there is no file , from the content length of the header because the operation is async , any stream supplied in the request must reference data ( files , buffers ) which stay valid until the upload completes retry policy : na : the transfer manager is performing the upload

public upload info put object ( put object request put object request ) { long len = get put request length ( put object request ) ; log debug ( " put { } bytes to { } via transfer manager " , len , put object request get key ( ) ) ; increment put start statistics ( len ) ; upload upload = transfers upload ( put object request ) ; return new upload info ( upload , len ) ; }


when the request resources is an ack or nack message in response to a previous request resources , the response nonce must be the nonce in the request resources otherwise response nonce must be omitted < code > string response nonce = 4 ; < code >

public builder clear response nonce ( ) { response nonce = get default instance ( ) get response nonce ( ) ; on changed ( ) ; return this ; }


low level conf value extraction test just to make sure that all works at the lower level

public void test conf extraction ( ) throws throwable { exit tracking service launcher < service > launcher = new exit tracking service launcher < > ( running service name ) ; launcher bind command options ( ) ; configuration conf = new conf ( " propagated " , " true " ) ; assert equals ( " true " , conf get ( " propagated " , " unset " ) ) ; configuration extracted = new configuration ( false ) ; list < string > args list = as list ( " name " , arg conf prefixed , config file ( conf ) ) ; list < string > args = launcher extract command options ( extracted , args list ) ; if ( ! args is empty ( ) ) { assert equals ( " args beginning with " + args get ( 0 ) , 0 , args size ( ) ) ; } assert equals ( " true " , extracted get ( " propagated " , " unset " ) ) ; }


appends { @ code values } , in order , to the end of the values the built { @ link immutable long array } will contain

public builder add all ( collection < long > values ) { ensure room for ( values size ( ) ) ; for ( long value : values ) { array [ count + + ] = value ; } return this ; }


get the list of hosts ( hostname ) hosting a cached replica of the block

public string [ ] get cached hosts ( ) { return cached hosts ; }


returns the comma separated intercepter class names from the configuration

private list < string > get interceptor class names ( configuration conf ) { string configured interceptor class names = conf get ( yarn configuration amrm proxy interceptor class pipeline , yarn configuration default amrm proxy interceptor class pipeline ) ; list < string > interceptor class names = new array list < string > ( ) ; collection < string > temp list = string utils get string collection ( configured interceptor class names ) ; for ( string item : temp list ) { interceptor class names add ( item trim ( ) ) ; } / / make sure distributed scheduler is present at the beginning of the chain if ( this nm context is distributed scheduling enabled ( ) ) { interceptor class names add ( 0 , distributed scheduler class get name ( ) ) ; } return interceptor class names ; }


always returns { @ code false } since jaxb 2 collection http message converter required generic type information in order to read a collection

public boolean can read ( class < ? > clazz , @ nullable media type media type ) { return false ; }


sets the < code > class name < code > property

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


returns the value associated with the given config option as an integer if no value is mapped under any key of the option , it returns the specified default instead of the option ' s default value

public int get integer ( config option < integer > config option , int override default ) { return get optional ( config option ) or else ( override default ) ; }


get blocks in the specified range includes only the complete blocks fetch them from the namenode if not cached

private list < located block > get finalized block range ( long offset , long length ) throws i o exception { synchronized ( info lock ) { assert ( located blocks ! = null ) : " located blocks is null " ; list < located block > block range = new array list < > ( ) ; / / search cached blocks first long remaining = length ; long cur off = offset ; while ( remaining > 0 ) { located block blk = fetch block at ( cur off , remaining , true ) ; assert cur off > = blk get start offset ( ) : " block not found " ; block range add ( blk ) ; long bytes read = blk get start offset ( ) + blk get block size ( ) - cur off ; remaining - = bytes read ; cur off + = bytes read ; } return block range ; } }


sets the < code > name < code > property

public additional properties any type name ( string name ) { this name = name ; return this ; }


returns a new date instance representing a time delay millis milliseconds in the future

date delayed date ( long delay millis ) { return new date ( system current time millis ( ) + delay millis ) ; }


public void delete ( string path , string accept type , route route , response transformer transformer ) { add route ( http method delete , response transformer route impl create ( path , accept type , route , transformer ) ) ; }


aggregates the given element see { @ link # get extreme elements ( ) }

public abstract void aggregate ( t element ) ;


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 clear config value ( ) { config value = empty protobuf list ( ) ; }


{ @ inherit doc } the evaluation of predicates by this context is short - circuiting , but unordered

public boolean eval ( recognizer < ? , ? > parser , rule context parser call stack ) { for ( semantic context opnd : opnds ) { if ( opnd eval ( parser , parser call stack ) ) return true ; } return false ; }


returns { @ code true } if a { @ link attribute key } exists for the given { @ code name }

public boolean exists ( string name ) { check not null and not empty ( name ) ; return constants contains key ( name ) ; }


return a predicate by which a snapshot info can be tested to see whether it should be deleted according to this retention policy

public predicate < snapshot info > get snapshot deletion predicate ( final list < snapshot info > all snapshots ) { final int total snapshot count = all snapshots size ( ) ; final list < snapshot info > sorted snapshots = all snapshots stream ( ) sorted ( comparator comparing long ( snapshot info : : start time ) ) collect ( collectors to list ( ) ) ; final long successful snapshot count = all snapshots stream ( ) filter ( snap - > snapshot state success equals ( snap state ( ) ) ) count ( ) ; final long newest successful timestamp = all snapshots stream ( ) filter ( snap - > snapshot state success equals ( snap state ( ) ) ) map to long ( snapshot info : : start time ) max ( ) or else ( long min value ) ; final set < snapshot state > unsuccessful states = set of ( snapshot state failed , snapshot state partial ) ; return si - > { final string snap name = si snapshot id ( ) get name ( ) ; / / first , if there ' s no expire after and a more recent successful snapshot , we can delete all the failed ones if ( this expire after = = null & & unsuccessful states contains ( si state ( ) ) & & newest successful timestamp > si start time ( ) ) { / / there ' s no expire after and there ' s a more recent successful snapshot , delete this failed one logger trace ( " [ { } ] : eligible as it is { } and there is a more recent successful snapshot " , snap name , si state ( ) ) ; return true ; } / / next , enforce the maximum count , if the size is over the maximum number of / / snapshots , then allow the oldest n ( where n is the number over the maximum snapshot / / count ) snapshots to be eligible for deletion if ( this maximum snapshot count ! = null ) { if ( successful snapshot count > this maximum snapshot count ) { final long snaps to delete = successful snapshot count - this maximum snapshot count ; final boolean eligible = sorted snapshots stream ( ) limit ( snaps to delete ) any match ( s - > s equals ( si ) ) ; if ( eligible ) { logger trace ( " [ { } ] : eligible as it is one of the { } oldest snapshots with " + " { } non - failed snapshots ( { } total ) , over the limit of { } maximum snapshots " , snap name , snaps to delete , successful snapshot count , total snapshot count , this maximum snapshot count ) ; return true ; } else { logger trace ( " [ { } ] : ineligible as it is not one of the { } oldest snapshots with " + " { } non - failed snapshots ( { } total ) , over the limit of { } maximum snapshots " , snap name , snaps to delete , successful snapshot count , total snapshot count , this maximum snapshot count ) ; return false ; } } } / / next check the minimum count , since that is a blanket requirement regardless of time , / / if we haven ' t hit the minimum then we need to keep the snapshot regardless of / / expiration time if ( this minimum snapshot count ! = null ) { if ( successful snapshot count < = this minimum snapshot count ) if ( unsuccessful states contains ( si state ( ) ) = = false ) { logger trace ( " [ { } ] : ineligible as there are { } non - failed snapshots ( { } total ) and { } minimum snapshots needed " , snap name , successful snapshot count , total snapshot count , this minimum snapshot count ) ; return false ; } else { logger trace ( " [ { } ] : skipping minimum snapshot count check as this snapshot is { } and not counted " + " towards the minimum snapshot count " , snap name , si state ( ) ) ; } } / / finally , check the expiration time of the snapshot , if it is past , then it is / / eligible for deletion if ( this expire after ! = null ) { final time value snapshot age = new time value ( now supplier get as long ( ) - si start time ( ) ) ; if ( this minimum snapshot count ! = null ) { final long eligible for expiration = math max ( 0 , successful snapshot count - minimum snapshot count ) ; / / only the oldest n snapshots are actually eligible , since if we went below this we / / would fall below the configured minimum number of snapshots to keep final stream < snapshot info > successful snaps eligible for expiration = sorted snapshots stream ( ) filter ( snap - > snapshot state success equals ( snap state ( ) ) ) limit ( eligible for expiration ) ; final stream < snapshot info > unsucessful snaps = sorted snapshots stream ( ) filter ( snap - > unsuccessful states contains ( snap state ( ) ) ) ; final set < snapshot info > snaps eligible for expiration = stream concat ( successful snaps eligible for expiration , unsucessful snaps ) collect ( collectors to set ( ) ) ; if ( snaps eligible for expiration contains ( si ) = = false ) { / / this snapshot is * not * one of the n oldest snapshots , so even if it were / / old enough , the other snapshots would be deleted before it logger trace ( " [ { } ] : ineligible as snapshot expiration would pass the " + " minimum number of configured snapshots ( { } ) to keep , regardless of age " , snap name , this minimum snapshot count ) ; return false ; } } if ( snapshot age compare to ( this expire after ) > 0 ) { logger trace ( " [ { } ] : eligible as snapshot age of { } is older than { } " , snap name , snapshot age to human readable string ( 3 ) , this expire after to human readable string ( 3 ) ) ; return true ; } else { logger trace ( " [ { } ] : ineligible as snapshot age of { } is newer than { } " , snap name , snapshot age to human readable string ( 3 ) , this expire after to human readable string ( 3 ) ) ; return false ; } } / / if nothing matched , the snapshot is not eligible for deletion logger trace ( " [ { } ] : ineligible as no retention predicates matched " , snap name ) ; return false ; } ; }


public long get data slot ( ) { return ( ( data high level shader language symbol internals 3 2 ) internals ) get data slot ( ) ; }


public cst base method ref get method ref ( ) { return ( cst base method ref ) get ref ( ) ; }


look up the fs by uri , return a ( cast ) mock wrapper

public static mock s 3 a file system lookup wrapper f s ( configuration conf ) throws i o exception { return ( mock s 3 a file system ) file system get ( output path uri , conf ) ; }


an extension method to convert a stomp encoded buffer to a different message type based on an original { @ link stomp headers subframe } headers sub frame by default an encoded buffer is returned as is

protected object convert headers sub frame ( stomp headers subframe original , byte buf encoded ) { return encoded ; }


consumes up to 4 bytes and returns them as int ( taking into account endianess ) throws exception if specified number of bytes cannot be consumed

public static int read packed int ( input stream is , int num bytes , boolean is little endian ) throws i o exception { int value = 0 ; for ( int i = 0 ; i < num bytes ; i + + ) { int b = is read ( ) ; if ( b = = - 1 ) { throw new i o exception ( " no more bytes " ) ; } if ( is little endian ) { value | = ( b & 0x f f ) < < ( i * 8 ) ; } else { value = ( value < < 8 ) | ( b & 0x f f ) ; } } return value ; }


populate , initialize , or clean up the database using the provided jdbc connection concrete implementations may throw an { @ link s q l exception } if an error is encountered but are strongly encouraged to throw a specific { @ link script exception } instead for example , spring ' s { @ link resource database populator } and { @ link database populator utils } wrap all { @ code s q l exceptions } in { @ code script exceptions }

void populate ( connection connection ) throws s q l exception , script exception ;


decorates the stream by wrapping it into a stream that applies a compression important : for streams returned by this method , { @ link output stream # close ( ) } is not propagated to the inner stream the inner stream must be closed separately

public final output stream decorate with compression ( output stream stream ) throws i o exception { return decorate with compression ( new non closing outpus stream decorator ( stream ) ) ; }


creates a plain { @ link list } backed by the current { @ link extension list }

public static < t > list < t > create list ( final class < t > type ) { return new abstract list < t > ( ) { private extension list < t > storage ( ) { return jenkins get ( ) get extension list ( type ) ; } @ override public iterator < t > iterator ( ) { return storage ( ) iterator ( ) ; } public t get ( int index ) { return storage ( ) get ( index ) ; } public int size ( ) { return storage ( ) size ( ) ; } @ override public boolean add ( t t ) { return storage ( ) add ( t ) ; } @ override public void add ( int index , t t ) { / / index ignored storage ( ) add ( t ) ; } @ override public t remove ( int index ) { return storage ( ) remove ( index ) ; } @ override public boolean remove ( object o ) { return storage ( ) remove ( o ) ; } } ; }


returns a { @ link collection } of all the permutations of the specified { @ link iterable } notes : this is an implementation of the algorithm for lexicographical permutations generation , described in knuth ' s " the art of computer programming " , volume 4 , chapter 7 , section 7 2 1 2 the iteration order follows the lexicographical order this means that the first permutation will be in ascending order , and the last will be in descending order duplicate elements are considered equal for example , the list [ 1 , 1 ] will have only one permutation , instead of two this is why the elements have to implement { @ link comparable } an empty iterable has only one permutation , which is an empty list this method is equivalent to { @ code collections 2 ordered permutations ( list , ordering natural ( ) ) }

public static < e extends comparable < ? super e > > collection < list < e > > ordered permutations ( iterable < e > elements ) { return ordered permutations ( elements , ordering natural ( ) ) ; }


public static sql method expr get ( ) { return instance ; }


construct and return a map from a high symbol ' s name to the high symbol object

public map < string , high symbol > get name to symbol map ( ) { map < string , high symbol > new map = new tree map < string , high symbol > ( ) ; for ( high symbol high symbol : symbol map values ( ) ) { new map put ( high symbol get name ( ) , high symbol ) ; } return new map ; }


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


verify that we correctly clean up even when a purging trigger has purged window state

private void test state and timer cleanup at event time g c with purging trigger ( final time domain adaptor time adaptor ) throws exception { window assigner < integer , time window > mock assigner = mock time window assigner ( ) ; time adaptor set is event time ( mock assigner ) ; trigger < integer , time window > mock trigger = mock trigger ( ) ; internal window function < iterable < integer > , void , integer , time window > mock window function = mock window function ( ) ; keyed one input stream operator test harness < integer , integer , void > test harness = create window operator ( mock assigner , mock trigger , 20l , mock window function ) ; test harness open ( ) ; when ( mock assigner assign windows ( any int ( ) , any long ( ) , any assigner context ( ) ) ) then return ( arrays as list ( new time window ( 0 , 20 ) ) ) ; assert equals ( 0 , test harness get output ( ) size ( ) ) ; assert equals ( 0 , test harness num keyed state entries ( ) ) ; do answer ( new answer < trigger result > ( ) { @ override public trigger result answer ( invocation on mock invocation ) throws exception { trigger trigger context context = ( trigger trigger context ) invocation get arguments ( ) [ 3 ] ; / / very far in the future so our watermark does not trigger it time adaptor register timer ( context , 1000l ) ; context get partitioned state ( value state descriptor ) update ( " hello " ) ; return trigger result purge ; } } ) when ( mock trigger ) on element ( matchers < integer > any object ( ) , any long ( ) , any time window ( ) , any trigger context ( ) ) ; do answer ( new answer < object > ( ) { @ override public object answer ( invocation on mock invocation ) throws exception { trigger trigger context context = ( trigger trigger context ) invocation get arguments ( ) [ 1 ] ; time adaptor delete timer ( context , 1000l ) ; context get partitioned state ( value state descriptor ) clear ( ) ; return null ; } } ) when ( mock trigger ) clear ( any time window ( ) , any trigger context ( ) ) ; test harness process element ( new stream record < > ( 0 , 0l ) ) ; / / clear is only called at cleanup time / gc time verify ( mock trigger , never ( ) ) clear ( any time window ( ) , any trigger context ( ) ) ; assert equals ( 1 , test harness num keyed state entries ( ) ) ; / / just the trigger state remains assert equals ( 2 , time adaptor num timers ( test harness ) ) ; / / window timers / gc timers assert equals ( 0 , time adaptor num timers other domain ( test harness ) ) ; time adaptor advance time ( test harness , 19 + 20 ) ; / / 19 is max time of the window verify ( mock trigger , times ( 1 ) ) clear ( any time window ( ) , any trigger context ( ) ) ; assert equals ( 0 , test harness num keyed state entries ( ) ) ; / / window contents plus trigger state assert equals ( 0 , time adaptor num timers ( test harness ) ) ; / / window timers / gc timers assert equals ( 0 , time adaptor num timers other domain ( test harness ) ) ; }


protected string canonical field name ( string field ) { return property accessor utils canonical property name ( field ) ; }


in most cases it will only be retrieved once ( see linked methods )

public byte [ ] get ( ) { return bytes ; }


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


sets all options equal to incoming options

public builder clone from ( display image options options ) { image res on loading = options image res on loading ; image res for empty uri = options image res for empty uri ; image res on fail = options image res on fail ; image on loading = options image on loading ; image for empty uri = options image for empty uri ; image on fail = options image on fail ; reset view before loading = options reset view before loading ; cache in memory = options cache in memory ; cache on disk = options cache on disk ; image scale type = options image scale type ; decoding options = options decoding options ; delay before loading = options delay before loading ; consider exif params = options consider exif params ; extra for downloader = options extra for downloader ; pre processor = options pre processor ; post processor = options post processor ; displayer = options displayer ; handler = options handler ; is sync loading = options is sync loading ; return this ; }


maps the label of a pre - copied block to the label of the inlined block , allocating a new label and adding it to the worklist if necessary if the orig label is a " special " label , it is returned exactly and not scheduled for duplication : copying never proceeds past a special label , which likely is the function return block or an immediate predecessor

private int map or allocate label ( int orig label ) { int result label ; integer mapped label = orig label to copied label get ( orig label ) ; if ( mapped label ! = null ) { result label = mapped label ; } else if ( ! involved in subroutine ( orig label , subroutine start ) ) { / * * a subroutine has ended by some means other than a " ret " * ( which really means a throw caught later ) * / result label = orig label ; } else { result label = label allocator get next label ( ) ; work list set ( orig label ) ; orig label to copied label put ( orig label , result label ) ; / / the new label has the same frame as the original label while ( label to subroutines size ( ) < = result label ) { label to subroutines add ( null ) ; } label to subroutines set ( result label , label to subroutines get ( orig label ) ) ; } return result label ; }


parses cds resource for a non - aggregate cluster ( eds or logical dns ) into { @ link io grpc xds xds client cds update } returns { @ code null } and nack the response with the given nonce if the resource is invalid

private cds update parse non aggregate cluster ( cluster cluster , string nonce , string lb policy , set < string > eds resources ) { string cluster name = cluster get name ( ) ; string lrs server name = null ; long max concurrent requests = null ; upstream tls context upstream tls context = null ; if ( cluster has lrs server ( ) ) { if ( ! cluster get lrs server ( ) has self ( ) ) { nack response ( resource type cds , nonce , " cluster " + cluster name + " : only support lrs for the same management server " ) ; return null ; } lrs server name = " " ; } if ( cluster has circuit breakers ( ) ) { list < thresholds > thresholds = cluster get circuit breakers ( ) get thresholds list ( ) ; for ( thresholds threshold : thresholds ) { if ( threshold get priority ( ) ! = routing priority default ) { continue ; } if ( threshold has max requests ( ) ) { max concurrent requests = ( long ) threshold get max requests ( ) get value ( ) ; } } } if ( cluster has transport socket ( ) & & transport socket name tls equals ( cluster get transport socket ( ) get name ( ) ) ) { any any = cluster get transport socket ( ) get typed config ( ) ; if ( any get type url ( ) equals ( type url upstream tls context v2 ) ) { any = any to builder ( ) set type url ( type url upstream tls context ) build ( ) ; } io envoyproxy envoy extensions transport sockets tls v 3 upstream tls context unpacked ; try { unpacked = any unpack ( io envoyproxy envoy extensions transport sockets tls v 3 upstream tls context class ) ; } catch ( invalid protocol buffer exception e ) { nack response ( resource type cds , nonce , " cluster " + cluster name + " : invalid upstream tls context : " + e ) ; return null ; } upstream tls context = upstream tls context from envoy proto upstream tls context ( unpacked ) ; } discovery type type = cluster get type ( ) ; if ( type = = discovery type eds ) { string eds service name = null ; io envoyproxy envoy config cluster v 3 cluster eds cluster config eds cluster config = cluster get eds cluster config ( ) ; if ( ! eds cluster config get eds config ( ) has ads ( ) ) { nack response ( resource type cds , nonce , " cluster " + cluster name + " : " + " field eds cluster config must be set to indicate to use eds over ads " ) ; return null ; } / / if the service name field is set , that value will be used for the eds request if ( ! eds cluster config get service name ( ) is empty ( ) ) { eds service name = eds cluster config get service name ( ) ; eds resources add ( eds service name ) ; } else { eds resources add ( cluster name ) ; } eds cluster config config = new eds cluster config ( lb policy , eds service name , lrs server name , max concurrent requests , upstream tls context ) ; return new cds update ( cluster name , cluster type eds , config ) ; } else if ( type equals ( discovery type logical dns ) ) { logical dns cluster config config = new logical dns cluster config ( lb policy , lrs server name , max concurrent requests , upstream tls context ) ; return new cds update ( cluster name , cluster type logical dns , config ) ; } nack response ( resource type cds , nonce , " cluster " + cluster name + " : unsupported built - in discovery type : " + type ) ; return null ; }


the value of the { @ code requires index } item must be a valid index into the constant pool the entry at that index must be a { @ link constant pool module info } structure denoting a module that the current module depends on

public int get requires index ( ) { return requires index & 0xffff ; }


adds the contents of this class path element to the given class path

public void append class path entries to ( class path class path , boolean output ) { file base dir = get project ( ) get base dir ( ) ; string [ ] file names ; if ( is reference ( ) ) { / / get the referenced path or file set object referenced object = get checked ref ( data type class , data type class get name ( ) ) ; if ( referenced object instanceof path ) { path path = ( path ) referenced object ; / / get the names of the files in the referenced path file names = path list ( ) ; } else if ( referenced object instanceof abstract file set ) { abstract file set file set = ( abstract file set ) referenced object ; / / get the names of the existing input files in the referenced file set directory scanner scanner = file set get directory scanner ( get project ( ) ) ; base dir = scanner get basedir ( ) ; file names = scanner get included files ( ) ; } else { throw new build exception ( " the refid attribute doesn ' t point to a < path > element or a < fileset > element " ) ; } } else { / / get the names of the files in this path file names = list ( ) ; } if ( output ) { if ( file names length ! = 1 ) { throw new build exception ( " the < outjar > element must specify exactly one file or directory [ " + file names length + " ] " ) ; } } / / else / / { / / if ( file names length < 1 ) / / { / / throw new build exception ( " the < injar > element must specify at least one file or directory " ) ; / / } / / } for ( int index = 0 ; index < file names length ; index + + ) { / / create a new class path entry , with the proper file name and / / any filters string file name = file names [ index ] ; file file = new file ( file name ) ; class path entry entry = new class path entry ( file is absolute ( ) ? file : new file ( base dir , file name ) , output ) ; entry set filter ( list util comma separated list ( filter ) ) ; entry set apk filter ( list util comma separated list ( apk filter ) ) ; entry set jar filter ( list util comma separated list ( jar filter ) ) ; entry set aar filter ( list util comma separated list ( aar filter ) ) ; entry set war filter ( list util comma separated list ( war filter ) ) ; entry set ear filter ( list util comma separated list ( ear filter ) ) ; entry set zip filter ( list util comma separated list ( zip filter ) ) ; / / add it to the class path class path add ( entry ) ; } } / / ant task attributes


validates that the given method ' s signature meets all of our assumptions

private static void validate method ( method method ) { string desc = method to string ( ) ; assert true ( desc , is any enter ( method ) | | is wait for ( method ) ) ; switch ( method get parameter types ( ) length ) { case 0 : assert false ( desc , is guarded ( method ) ) ; assert false ( desc , is timed ( method ) ) ; break ; case 1 : assert true ( desc , is guarded ( method ) ) ; assert false ( desc , is timed ( method ) ) ; break ; case 2 : assert false ( desc , is guarded ( method ) ) ; assert true ( desc , is timed ( method ) ) ; break ; case 3 : assert true ( desc , is guarded ( method ) ) ; assert true ( desc , is timed ( method ) ) ; break ; default : fail ( desc ) ; } if ( method get return type ( ) = = void class ) { assert false ( desc , is boolean ( method ) ) ; } else { assert true ( desc , is boolean ( method ) ) ; } switch ( method get exception types ( ) length ) { case 0 : assert false ( desc , is interruptible ( method ) ) ; break ; case 1 : assert true ( desc , is interruptible ( method ) ) ; break ; default : fail ( desc ) ; } if ( is enter if ( method ) ) { assert true ( desc , is guarded ( method ) ) ; assert true ( desc , is boolean ( method ) ) ; } else if ( is try enter ( method ) ) { assert false ( desc , is timed ( method ) ) ; assert true ( desc , is boolean ( method ) ) ; assert false ( desc , is interruptible ( method ) ) ; } else if ( is wait for ( method ) ) { assert true ( desc , is guarded ( method ) ) ; assert equals ( desc , is timed ( method ) , is boolean ( method ) ) ; } else { / / any other enter xxx method assert equals ( desc , is timed ( method ) , is boolean ( method ) ) ; } }


returns an immutable range set containing the specified single range if { @ link range # is empty ( ) range is empty ( ) } , this is equivalent to { @ link immutable range set # of ( ) }

public static < c extends comparable > immutable range set < c > of ( range < c > range ) { check not null ( range ) ; if ( range is empty ( ) ) { return of ( ) ; } else if ( range equals ( range all ( ) ) ) { return all ( ) ; } else { return new immutable range set < c > ( immutable list of ( range ) ) ; } }


returns whether a string contains any xml special characters if this function returns true , the string will need to be encoded either using the string encode x m l function above or using a cdata section note that msxml has a nasty bug whereby whitespace characters outside of a cdata section are lost when parsing to avoid hitting this bug , this method treats many whitespace characters as " special "

private static boolean string has x m l specials ( string input ) { for ( int i = 0 ; i < input length ( ) ; i + + ) { char c = input char at ( i ) ; switch ( c ) { case ' < ' : case ' > ' : case ' " ' : case ' \ ' ' : case ' & ' : case ' \ t ' : case ' \ n ' : case ' \ r ' : return true ; } } return false ; }


see value ( type ) above this method is only meant for starlark usage

public builder < type > default value ( object default value ) throws conversion exception { return default value ( default value , null , null ) ; }


gets the y coordinate of the pivot point

public float get pivot y ( ) { return calc average ( m detector get start y ( ) , m detector get pointer count ( ) ) ; }


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

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


returns an array with { @ link # count ( ) } { @ link native datagram packet } s filled

native datagram packet [ ] packets ( ) { return packets ; }


process an exception generated against the change policy if the exception indicates the file has changed , this method throws { @ code remote file changed exception } with the original exception as the cause

public void process exception ( sdk base exception e , string operation ) throws remote file changed exception { if ( e instanceof amazon service exception ) { amazon service exception service exception = ( amazon service exception ) e ; / / this isn ' t really going to be hit due to / / https : / / github com / aws / aws - sdk - java / issues / 1644 if ( service exception get status code ( ) = = sc precondition failed ) { version mismatches version mismatch error ( ) ; throw new remote file changed exception ( uri , operation , string format ( remote file changed exception preconditions failed + " on % s " + " version % s was unavailable " , get source ( ) , get revision id ( ) ) , service exception ) ; } } }


public void remove layout listener ( layout listener < v , e > listener ) ;


this implementation returns a url for the underlying class path resource , if available

public url get u r l ( ) throws i o exception { url url = resolve u r l ( ) ; if ( url = = null ) { throw new file not found exception ( get description ( ) + " cannot be resolved to url because it does not exist " ) ; } return url ; }


get the last node associated with a specific { @ code label } for example , for pattern { @ code < id : id > } , { @ code get ( " id " ) } returns the node matched for that { @ code id } if more than one node matched the specified label , only the last is returned if there is no node associated with the label , this returns { @ code null } pattern tags like { @ code < id > } and { @ code < expr > } without labels are considered to be labeled with { @ code id } and { @ code expr } , respectively

public parse tree get ( string label ) { list < parse tree > parse trees = labels get ( label ) ; if ( parse trees = = null | | parse trees size ( ) = = 0 ) { return null ; } return parse trees get ( parse trees size ( ) - 1 ) ; / / return last if multiple }


asks this shard to stop throttling indexing to one thread

protected void deactivate throttling ( index shard shard ) { shard deactivate throttling ( ) ; }


gets a short name after the removal version number of a so file

public static string get so short name ( file so file ) { string base name = filename utils get base name ( so file get name ( ) ) ; string short name = base name replace all ( " - ( \ \ d * \ \ \ \ d * ) * " , " " ) ; return short name + " " + filename utils get extension ( so file get name ( ) ) ; }


to test \ & quot ; client \ & quot ; model to test \ & quot ; client \ & quot ; model

public void test client model test ( ) { client body = null ; client response = api test client model ( body ) ; / / todo : test validations }


variant of { @ link # data ( object ) } that also accepts a hint for the types of values that will be produced the class hint is used to find a compatible { @ code encoder } once , up front vs per value

retrieve spec data ( object producer , class < ? > element class ) ;


return the singleton instance for the current process

public static readahead pool get instance ( ) { synchronized ( readahead pool class ) { if ( instance = = null & & native i o is available ( ) ) { instance = new readahead pool ( ) ; } return instance ; } }


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


public static string post form ( string data , string url ) { return do http action ( data , false , true , url ) ; }


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


this method is a convenience for testing code should call { @ link segment # copy entry } directly

reference entry < k , v > copy entry ( reference entry < k , v > original , reference entry < k , v > new next ) { int hash = original get hash ( ) ; return segment for ( hash ) copy entry ( original , new next ) ; }


private remote file changed exception expect read failure ( final f s data input stream instream ) throws exception { return intercept ( remote file changed exception class , " " , " read ( ) returned " , ( ) - > read to text ( instream read ( ) ) ) ; }


the pointer that initially pressed this button or - 1 if the button is not pressed

public int get pressed pointer ( ) { return pressed pointer ; }


get resources using the secondary background color

public static set < string > get secondary background resources ( ) { return collections unmodifiable set ( sets new hash set ( " completion popup background " , " checkbox background disabled " , " checkbox background disabled dark " , " checkbox border disabled " , " checkbox border disabled dark " , " code with me access enabled pill background " , " code with me access enabled dropdown border " , " editor groups tabs border color " , " editor tabs border color " , " inactive caption " , " list background " , " memory indicator allocated background " , " memory indicator unused color " , / / deprecated " menu border color " , " parameter info background " , " plugins section header background " , " popup separator color " , " separator background " , " separator foreground " , " separator separator color " , " slider tick color " , " table light selection inactive background " , " text area background " , " toolbar floating background " , " tool window active header background " , " tool window header background " , " tool window header active background " , / / deprecated " tool window header border background " , / / deprecated " tool window header border color " , " u i designer motion our avg background " , " u i designer motion constraint set background " , " u i designer motion our c s background " , " welcome screen side panel background " , " welcome screen projects background " , " welcome screen projects selection inactive background " ) ) ; }


set a unique number for pcode ops that are attached to the same address

public final void set time ( int t ) { seqnum set time ( t ) ; }


registers an injection listener for type { @ code i } guice will notify the listener after all injections have been performed on an instance of { @ code i }

void register ( injection listener < ? super i > listener ) ;


true when this type ' s bindings use raw integer values instead of { @ code r } references

private boolean has unqualified resource bindings ( ) { for ( resource binding binding : resource bindings ) { if ( ! binding id ( ) qualifed ) { return true ; } } return false ; }


get the suitable { @ link network interface }

public static network interface find network interface ( ) { list < network interface > valid network interfaces = empty list ( ) ; try { valid network interfaces = get valid network interfaces ( ) ; } catch ( throwable e ) { logger warn ( e ) ; } network interface result = null ; / / try to find the preferred one for ( network interface network interface : valid network interfaces ) { if ( is preferred network interface ( network interface ) ) { result = network interface ; break ; } } if ( result = = null ) { / / if not found , try to get the first one for ( network interface network interface : valid network interfaces ) { enumeration < inet address > addresses = network interface get inet addresses ( ) ; while ( addresses has more elements ( ) ) { optional < inet address > address op = to valid address ( addresses next element ( ) ) ; if ( address op is present ( ) ) { try { if ( address op get ( ) is reachable ( 100 ) ) { result = network interface ; break ; } } catch ( i o exception e ) { / / ignore } } } } } if ( result = = null ) { result = first ( valid network interfaces ) ; } return result ; }


public synchronized mutable counter int new counter ( metrics info info , int i val ) { check metric name ( info name ( ) ) ; mutable counter int ret = new mutable counter int ( info , i val ) ; metrics map put ( info name ( ) , ret ) ; return ret ; }


moves the clock forward , for tests that require moving the clock forward it is the transport subclass ' s responsibility to implement this method

protected void advance clock ( long offset , time unit unit ) { throw new unsupported operation exception ( ) ; }


determines if at least one of the filter types is set to replace or merge

public boolean is set ( ) { int num = filter flags length ; for ( int i = 0 ; i < num ; i + + ) { if ( filter flags [ i ] ! = ignore ) { return true ; } } return false ; }


void remove listener ( playlist event listener listener ) ;


flink - 5667 tests that a concurrent cancel operation discards the state handles of a not yet acknowledged checkpoint and prevents sending an acknowledge message to the checkpoint coordinator the situation can only happen if the cancel call is executed before environment acknowledge checkpoint ( )

public void test async checkpointing concurrent close before acknowledge ( ) throws exception { final testing keyed state handle managed keyed state handle = new testing keyed state handle ( ) ; final testing keyed state handle raw keyed state handle = new testing keyed state handle ( ) ; final testing operator state handle managed operator state handle = new testing operator state handle ( ) ; final testing operator state handle raw operator state handle = new testing operator state handle ( ) ; final blocking runnable future < snapshot result < keyed state handle > > raw keyed state handle future = new blocking runnable future < > ( 2 , snapshot result of ( raw keyed state handle ) ) ; operator snapshot futures operator snapshot result = new operator snapshot futures ( done future of ( snapshot result of ( managed keyed state handle ) ) , raw keyed state handle future , done future of ( snapshot result of ( managed operator state handle ) ) , done future of ( snapshot result of ( raw operator state handle ) ) , done future of ( snapshot result empty ( ) ) , done future of ( snapshot result empty ( ) ) ) ; final one input stream operator < string , string > stream operator = stream operator with snapshot ( operator snapshot result ) ; final acknowledge dummy environment mock environment = new acknowledge dummy environment ( ) ; running task < mock stream task > task = run task ( ( ) - > create mock stream task ( mock environment , operator chain ( stream operator ) ) ) ; wait task is running ( task stream task , task invocation future ) ; final long checkpoint id = 42l ; task stream task trigger checkpoint async ( new checkpoint meta data ( checkpoint id , 1l ) , checkpoint options for checkpoint with default location ( ) , false ) ; raw keyed state handle future await run ( ) ; task stream task cancel ( ) ; final future utils conjunct future < void > discard future = future utils wait for all ( as list ( managed keyed state handle get discard future ( ) , raw keyed state handle get discard future ( ) , managed operator state handle get discard future ( ) , raw operator state handle get discard future ( ) ) ) ; / / make sure that all state handles have been discarded discard future get ( ) ; try { mock environment get acknowledge checkpoint future ( ) get ( 10l , time unit milliseconds ) ; fail ( " the checkpoint should not get acknowledged " ) ; } catch ( timeout exception expected ) { / / future should not be completed } task wait for task completion ( true ) ; }


public static boolean in global transaction ( ) { return context holder get ( key xid ) ! = null ; }


handle a local time that happened before the start of an overlap

long before overlap ( long local millis , overlap overlap ) ;


public offset date time get date time ( ) { return date time ; }


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


private static list < sub component > get immediate sub components ( component context context , component component , int width spec , int height spec ) { final list < component > components = extract immediate sub components ( context , component , width spec , height spec ) ; final list < sub component > sub components = new array list < > ( components size ( ) ) ; for ( component lifecycle : components ) { sub components add ( sub component of ( lifecycle ) ) ; } return sub components ; }


what is the index of the current character of lookahead ?

public int get char index ( ) { return input index ( ) ; }


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

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


protected int get current backoff ( ) { return current backoff < = 0 ? 0 : current backoff ; }


public static string get date ( ) { return yarn version info get date ( ) ; }


in this test , some pools have minimum shares set pool 1 has a min share of 20 so it gets 20 slots pool 2 also has a min share of 20 , but its demand is only 10 so it can only get 10 slots the remaining pools have 10 slots to split between them pool 4 gets 3 slots because its demand is only 3 , and pool 3 gets the remaining 7 slots pool 4 also had a min share of 2 slots but this should not affect the outcome

public void test min shares ( ) { scheds add ( new fake schedulable ( 20 ) ) ; scheds add ( new fake schedulable ( 18 ) ) ; scheds add ( new fake schedulable ( 0 ) ) ; scheds add ( new fake schedulable ( 2 ) ) ; compute fair shares compute shares ( scheds , resources create resource ( 40 ) , resource information memory mb get name ( ) ) ; verify memory shares ( 20 , 18 , 0 , 2 ) ; }


attempts to execute all the listeners in { @ link # listeners } while not holding the { @ link # monitor }

private void dispatch listener events ( ) { if ( ! monitor is occupied by current thread ( ) ) { listeners dispatch ( ) ; } }


reads a { @ link named writeable } from the current stream , by first reading its name and then looking for the corresponding entry in the registry by name , so that the proper object can be read and returned default implementation throws { @ link unsupported operation exception } as stream input doesn ' t hold a registry use { @ link filter input stream } instead which wraps a stream and supports a { @ link named writeable registry } too

public < c extends named writeable > c read named writeable ( @ suppress warnings ( " unused " ) class < c > category class ) throws i o exception { throw new unsupported operation exception ( " can ' t read named writeable from stream input " ) ; }


public static class loader get class loader ( class < ? > clazz ) { class loader cl = null ; try { cl = thread current thread ( ) get context class loader ( ) ; } catch ( throwable ex ) { / / cannot access thread context class loader - falling back to system class loader } if ( cl = = null ) { / / no thread context class loader - > use class loader of this class cl = clazz get class loader ( ) ; if ( cl = = null ) { / / get class loader ( ) returning null indicates the bootstrap class loader try { cl = class loader get system class loader ( ) ; } catch ( throwable ex ) { / / cannot access system class loader - oh well , maybe the caller can live with null } } } return cl ; }


create a rpc service for the task manager

static rpc service create rpc service ( final configuration configuration , final high availability services ha services ) throws exception { check not null ( configuration ) ; check not null ( ha services ) ; return akka rpc service utils create remote rpc service ( configuration , determine task manager bind address ( configuration , ha services ) , configuration get string ( task manager options rpc port ) , configuration get string ( task manager options bind host ) , configuration get optional ( task manager options rpc bind port ) ) ; }


convert the request into a multipart request , and make multipart resolver available if no multipart resolver is set , simply use the existing request

protected http servlet request check multipart ( http servlet request request ) throws multipart exception { if ( this multipart resolver ! = null & & this multipart resolver is multipart ( request ) ) { if ( web utils get native request ( request , multipart http servlet request class ) ! = null ) { if ( request get dispatcher type ( ) equals ( dispatcher type request ) ) { logger trace ( " request already resolved to multipart http servlet request , e g by multipart filter " ) ; } } else if ( has multipart exception ( request ) ) { logger debug ( " multipart resolution previously failed for current request - " + " skipping re - resolution for undisturbed error rendering " ) ; } else { try { return this multipart resolver resolve multipart ( request ) ; } catch ( multipart exception ex ) { if ( request get attribute ( web utils error exception attribute ) ! = null ) { logger debug ( " multipart resolution failed for error dispatch " , ex ) ; / / keep processing error dispatch with regular request handle below } else { throw ex ; } } } } / / if not returned before : return original request return request ; }


transition to the completed state and set the value

boolean set ( @ nullable v v ) { return complete ( v , null , completed ) ; }


returns true if the set of windows associated with this window manager are visible

public boolean is visible ( ) { return is visible ; }


logs user into the system ( asynchronously )

public okhttp 3 call login user async ( string username , string password , final api callback < string > callback ) throws api exception { okhttp 3 call local var call = login user validate before call ( username , password , 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 ; }


get the < code > application attempt report < code > for the application attempt

public abstract void set application attempt report ( application attempt report application attempt report ) ;


create a collect packages under directory request

public static sky key key ( repository name repository , rooted path rooted path , immutable set < path fragment > excluded paths ) { return key create ( repository , rooted path , excluded paths ) ; }


get the current sub - process executing the given command

public process process ( ) { return process ; }


method strip white space removes all blanks and control characters from the original string

public static string strip white space ( string original ) { if ( original = = null ) { return null ; } int length = original length ( ) ; char [ ] result = new char [ length ] ; int orig index = 0 ; int result index = 0 ; for ( ; orig index < length ; orig index + + ) { / / don ' t keep blanks or control characters which are less than a blank char c = original char at ( orig index ) ; if ( c > ' ' ) { result [ result index + + ] = c ; } } return new string ( result , 0 , result index ) ; }


get the container to which this client is bound

public string get container ( ) { return container ; }


set { @ link # block u c state } to { @ link block u c state # committed }

void commit ( ) { block u c state = block u c state committed ; }


record the effects of a { @ link file system # rename ( path , path ) } in the metadata store clients provide explicit enumeration of the affected paths ( recursively ) , before and after the rename this operation is not atomic , unless specific implementations claim otherwise on the need to provide an enumeration of directory trees instead of just source and destination paths : since a metadata store does not have to track all metadata for the underlying storage system , and a new metadata store may be created on an existing underlying filesystem , this move ( ) may be the first time the metadata store sees the affected paths therefore , simply providing src and destination paths may not be enough to record the deletions ( under src path ) and creations ( at destination ) that are happening during the rename ( )

void move ( @ nullable collection < path > paths to delete , @ nullable collection < path metadata > paths to create , @ nullable bulk operation state operation state ) throws i o exception ;


check that a partition step was done correctly for debugging and testing

public static void check partition ( int [ ] order , double [ ] values , double pivot value , int start , int low , int high , int end ) { if ( order length ! = values length ) { throw new illegal argument exception ( " arguments must be same size " ) ; } if ( ! ( start > = 0 & & low > = start & & high > = low & & end > = high ) ) { throw new illegal argument exception ( format ( " invalid indices % d , % d , % d , % d " , start , low , high , end ) ) ; } for ( int i = 0 ; i < low ; i + + ) { double v = values [ order [ i ] ] ; if ( v > = pivot value ) { throw new illegal argument exception ( format ( " value greater than pivot at % d " , i ) ) ; } } for ( int i = low ; i < high ; i + + ) { if ( values [ order [ i ] ] ! = pivot value ) { throw new illegal argument exception ( format ( " non - pivot at % d " , i ) ) ; } } for ( int i = high ; i < end ; i + + ) { double v = values [ order [ i ] ] ; if ( v < = pivot value ) { throw new illegal argument exception ( format ( " value less than pivot at % d " , i ) ) ; } } }


read a double - precision 64 - bit format ieee 754 value

public static double read double ( byte buffer buffer ) { return buffer get double ( ) ; }


interprets the contents as notification lite objects and calls the appropriate observer method

public < u > boolean accept ( observer < ? super u > observer ) { object [ ] a = head ; final int c = capacity ; while ( a ! = null ) { for ( int i = 0 ; i < c ; i + + ) { object o = a [ i ] ; if ( o = = null ) { break ; } if ( notification lite accept full ( o , observer ) ) { return true ; } } a = ( object [ ] ) a [ c ] ; } return false ; }


encode cases where " hu - " is pronounced as part of a vowel dipthong

boolean encode initial hu hw ( ) { / / spanish spellings and chinese pinyin transliteration if ( string at ( 0 , 3 , " hua " , " hue " , " hwa " , " " ) ) { if ( ! string at ( m current , 4 , " huey " , " " ) ) { metaph add ( " a " ) ; if ( ! m encode vowels ) { m current + = 3 ; } else { m current + + ; / / don ' t encode vowels twice while ( is vowel ( m current ) | | ( char at ( m current ) = = ' w ' ) ) { m current + + ; } } return true ; } } return false ; }


apply any revision control set by the policy if it is to be enforced on the server

public boolean maybe apply constraint ( final get object request request ) { if ( policy get mode ( ) = = change detection policy mode server & & revision id ! = null ) { policy apply revision constraint ( request , revision id ) ; return true ; } return false ; }


test { @ link bloom map file reader } constructor with i o exception

public void test i o exception in writer constructor ( ) { path dir name spy = spy ( test file ) ; bloom map file reader reader = null ; bloom map file writer writer = null ; try { writer = new bloom map file writer ( conf , test file , map file writer key class ( int writable class ) , map file writer value class ( text class ) ) ; writer append ( new int writable ( 1 ) , new text ( " 123124142 " ) ) ; writer close ( ) ; when ( dir name spy get file system ( conf ) ) then throw ( new i o exception ( ) ) ; reader = new bloom map file reader ( dir name spy , conf , map file reader comparator ( new writable comparator ( int writable class ) ) ) ; assert null ( " test i o exception in writer constructor error ! ! ! " , reader get bloom filter ( ) ) ; } catch ( exception ex ) { fail ( " unexpect ex in test i o exception in writer constructor ! ! ! " ) ; } finally { i o utils cleanup with logger ( log , writer , reader ) ; } }


return a { @ link resolvable type } for the specified { @ link method parameter }

public static resolvable type for method parameter ( method parameter method parameter ) { return for method parameter ( method parameter , ( type ) null ) ; }


temporary storage forecast is allowed to use for persisting models

public string get tmp storage ( ) { return tmp storage ; }


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


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


private path make absolute ( path work dir , path path ) { if ( path is absolute ( ) ) { return path ; } return new path ( work dir , path ) ; }


returns the methods with { @ code member name index } declared by { @ code declaring type } and its subtypes

private set < integer > get method ids ( dex dex , set < integer > member name indexes , int declaring type ) { set < integer > subtypes = find assignable types ( dex , declaring type ) ; set < integer > methods = new hash set < integer > ( ) ; int method index = 0 ; for ( method id method : dex method ids ( ) ) { if ( member name indexes contains ( method get name index ( ) ) & & subtypes contains ( method get declaring class index ( ) ) ) { methods add ( method index ) ; } method index + + ; } return methods ; }


notifies that an additional { @ code window size increment } bytes can be sent on { @ code stream id } , or the connection if { @ code stream id } is zero

void window update ( int stream id , long window size increment ) ;


recovers the memory resources for container

public void recover memory ( container id container id , long memory ) { container vs mem usage put ( container id , memory ) ; used memory + = memory ; }


set whether to return buckets as a hash or as an array , and return the builder so that calls can be chained

public date histogram aggregation builder keyed ( boolean keyed ) { this keyed = keyed ; return this ; }


start this connector this method will only be called on a clean connector , i e it has either just been instantiated and initialized or { @ link # stop ( ) } has been invoked

public abstract void start ( map < string , string > props ) ;


called when the specified controller has sent skip forward

int on skip forward ( media session session , controller info controller info ) ;


specifies the order of iteration for the elements of { @ link network # edges ( ) } the default value is { @ link element order # insertion ( ) insertion order }

public < e1 extends e > network builder < n , e1 > edge order ( element order < e1 > edge order ) { network builder < n , e1 > new builder = cast ( ) ; new builder edge order = check not null ( edge order ) ; return new builder ; }


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


clears and disposes all assets and the preloading queue

public synchronized void clear ( ) { load queue clear ( ) ; while ( ! update ( ) ) ; object int map < string > dependency count = new object int map < string > ( ) ; while ( asset types size > 0 ) { / / for each asset , figure out how often it was referenced dependency count clear ( ) ; array < string > assets = asset types keys ( ) to array ( ) ; for ( string asset : assets ) dependency count put ( asset , 0 ) ; for ( string asset : assets ) { array < string > dependencies = asset dependencies get ( asset ) ; if ( dependencies = = null ) continue ; for ( string dependency : dependencies ) { int count = dependency count get ( dependency , 0 ) ; count + + ; dependency count put ( dependency , count ) ; } } / / only dispose of assets that are root assets ( not referenced ) for ( string asset : assets ) if ( dependency count get ( asset , 0 ) = = 0 ) unload ( asset ) ; } this assets clear ( ) ; this asset types clear ( ) ; this asset dependencies clear ( ) ; this loaded = 0 ; this to load = 0 ; this peak tasks = 0 ; this load queue clear ( ) ; this tasks clear ( ) ; }


public static double get double ( memory segment [ ] segments , int offset ) { if ( in first segment ( segments , offset , 8 ) ) { return segments [ 0 ] get double ( offset ) ; } else { return get double multi segments ( segments , offset ) ; } }


verify block placement policy node group uses network topology with node group

public void test b p p node group ( ) throws exception { configuration conf = create conf ( ) ; conf set boolean ( d f s config keys dfs use dfs network topology key , true ) ; long [ ] capacities = new long [ ] { capacity , capacity , capacity , capacity } ; string [ ] racks = new string [ ] { rack0 , rack0 , rack1 , rack1 } ; string [ ] node groups = new string [ ] { nodegroup0 , nodegroup0 , nodegroup1 , nodegroup2 } ; int num of datanodes = capacities length ; assert equals ( num of datanodes , racks length ) ; assert equals ( num of datanodes , node groups length ) ; mini d f s cluster builder builder = new mini d f s cluster builder ( conf ) num data nodes ( capacities length ) racks ( racks ) simulated capacities ( capacities ) ; mini d f s cluster with node group set node groups ( node groups ) ; lambda test utils intercept ( illegal argument exception class , " configured cluster topology should be " + " org apache hadoop net network topology with node group " , ( ) - > new mini d f s cluster with node group ( builder ) ) ; }


sets the < code > name < code > property

public additional properties boolean name ( string name ) { this name = name ; return this ; }


public nodes stats request builder set discovery ( boolean discovery ) { add or remove metric ( discovery , nodes stats request metric discovery ) ; return this ; }


public file status [ ] list sub paths ( path path , boolean recursive , boolean newest ) throws i o exception { final collection < file status > file statuses ; file statuses = list directory ( to dir path ( path ) , recursive , newest ) ; return file statuses to array ( new file status [ file statuses size ( ) ] ) ; }


completes the co - group operation with the user function that is executed for windowed groups < b > note : < b > this is a temporary workaround while the { @ link # apply ( co group function ) } method has the wrong return type and hence does not allow one to set an operator - specific parallelism

public < t > single output stream operator < t > with ( co group function < t1 , t2 , t > function ) { return ( single output stream operator < t > ) apply ( function ) ; }


advances the position until after the next newline character if the line is terminated by " \ r \ n " , the ' \ n ' must be consumed as whitespace by the caller

private void skip to end of line ( ) throws i o exception { long index = source index of element ( linefeed or carriage return ) ; buffer skip ( index ! = - 1 ? index + 1 : buffer size ( ) ) ; }


converts the given number of the current units into tebibytes

public long to tebibytes ( long l ) { return tebibytes convert ( l , this ) ; }


sets the < code > bool item < code > property

public type holder example bool item ( boolean bool item ) { this bool item = bool item ; return this ; }


return the milliseconds differ time span

public static long get millis ( final long millis , final long time span , @ time constants unit final int unit ) { return millis + time span 2 millis ( time span , unit ) ; }


the value assigned to this plural < code > optional aapt pb item item = 4 ; < code >


checks if there are overlapping entries in the given logs

private static boolean has overlapping log entries ( log entries first log , log entries second log ) { for ( log entry first entry : first log ) { for ( log entry second entry : second log ) { if ( first entry get level ( ) get name ( ) equals ( second entry get level ( ) get name ( ) ) & & first entry get message ( ) equals ( second entry get message ( ) ) & & first entry get timestamp ( ) = = second entry get timestamp ( ) ) { return true ; } } } return false ; }


creates an embedded server of type corresponding to the provided identifier

public static embedded server create ( object identifier , routes route matcher , exception mapper exception mapper , static files configuration static files configuration , boolean multiple handlers ) { embedded server factory factory = factories get ( identifier ) ; if ( factory ! = null ) { return factory create ( route matcher , static files configuration , exception mapper , multiple handlers ) ; } else { throw new runtime exception ( " no embedded server matching the identifier " ) ; } }


add special advisors if necessary to work with a proxy chain that contains aspect j advisors : concretely , { @ link expose invocation interceptor } at the beginning of the list this will expose the current spring aop invocation ( necessary for some aspect j pointcut matching ) and make available the current aspect j join point the call will have no effect if there are no aspect j advisors in the advisor chain

public static boolean make advisor chain aspect j capable if necessary ( list < advisor > advisors ) { / / don ' t add advisors to an empty list ; may indicate that proxying is just not required if ( ! advisors is empty ( ) ) { boolean found aspect j advice = false ; for ( advisor advisor : advisors ) { / / be careful not to get the advice without a guard , as this might eagerly / / instantiate a non - singleton aspect j aspect if ( is aspect j advice ( advisor ) ) { found aspect j advice = true ; break ; } } if ( found aspect j advice & & ! advisors contains ( expose invocation interceptor advisor ) ) { advisors add ( 0 , expose invocation interceptor advisor ) ; return true ; } } return false ; }


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


note the same entry instance is returned each time this method is called

public entry next ( ) { if ( ! has next ) throw new no such element exception ( ) ; if ( ! valid ) throw new gdx runtime exception ( " # iterator ( ) cannot be used nested " ) ; int [ ] key table = map key table ; if ( next index = = index zero ) { entry key = 0 ; entry value = map zero value ; } else { entry key = key table [ next index ] ; entry value = map value table [ next index ] ; } current index = next index ; find next index ( ) ; return entry ; }


d b p project get singleton project ( ) ;


find the first occurrence of the given bytes b in a utf - 8 encoded string

public static int find bytes ( byte [ ] utf , int start , int end , byte [ ] b ) { int match end = end - b length ; for ( int i = start ; i < = match end ; i + + ) { boolean matched = true ; for ( int j = 0 ; j < b length ; j + + ) { if ( utf [ i + j ] ! = b [ j ] ) { matched = false ; break ; } } if ( matched ) { return i ; } } return - 1 ; }


transitively build all given artifacts , targets , and tests , and all necessary prerequisites thereof for sequential implementations of this interface , the top - level requests will be built in the iteration order of the set provided ; for concurrent implementations , the order is undefined this method should not be invoked more than once concurrently on the same builder instance

void build artifacts ( reporter reporter , set < artifact > artifacts , set < configured target > parallel tests , set < configured target > exclusive tests , set < configured target > targets to build , set < configured target > targets to skip , immutable set < aspect key > aspects , executor executor , set < configured target key > built targets , set < aspect key > built aspects , options provider options , @ nullable range < long > last execution time range , top level artifact context top level artifact context , boolean trust remote artifacts ) throws build failed exception , abrupt exit exception , interrupted exception , test exec exception ;


this is when the round up formatters are created in further merges ( with | | ) it will only append them to a list | | is not expected to be provided as format when a round up formatter is created it will be splitted before in < code > date formatter for pattern < code > java date formatter created with a custom format like < code > date formatter for pattern ( " yyyy " ) < code > will only have one parser it is however possible to have a java date formatter with multiple parsers for instance see a " date time " formatter in < code > date formatters < code > this means that we need to also have multiple round up parsers

private list < date time formatter > create round up parser ( string format , consumer < date time formatter builder > roundup parser consumer ) { if ( format contains ( " | | " ) = = false ) { list < date time formatter > round up parsers = new array list < > ( ) ; for ( date time formatter parser : this parsers ) { date time formatter builder builder = new date time formatter builder ( ) ; builder append ( parser ) ; roundup parser consumer accept ( builder ) ; round up parsers add ( builder to formatter ( locale ( ) ) ) ; } return round up parsers ; } return null ; }


sets the content of the system clipboard for web g l app , clipboard content might not be set if user denied permission , setting clipboard is not synchronous so you can ' t rely on getting same content just after setting it

public void set contents ( string content ) ;


protected final t create unmapped instance ( string name ) { map < string , object > metadata = new hash map < > ( ) ; int metadata count = random boolean ( ) ? 0 : between ( 1 , 10 ) ; while ( metadata size ( ) < metadata count ) { metadata put ( random alpha of length ( 5 ) , random alpha of length ( 5 ) ) ; } return create unmapped instance ( name , metadata ) ; }


static method to execute a shell command covers most of the simple cases without requiring the user to implement the < code > shell < code > interface

public static string exec command ( string cmd ) throws i o exception { return exec command ( null , cmd , 0l ) ; }


creates a bucket ordering strategy that sorts buckets by their document counts ( ascending or descending )

public static bucket order count ( boolean asc ) { return asc ? internal order count asc : internal order count desc ; }


returns whether all maps are empty ; used for checking for resource leaks in case entries aren ' t properly removed

boolean are all maps empty ( ) { return task executor to data sets is empty ( ) & & data set to task executors is empty ( ) & & data set meta info is empty ( ) & & partition release completion futures is empty ( ) ; }


public x get current value ( ) throws i o exception , interrupted exception { return value ; }


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

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


public void start ( ) { if ( is in state ( state started ) ) { return ; } / / enter the started state synchronized ( state change lock ) { if ( state model enter state ( state started ) ! = state started ) { try { start time = system current time millis ( ) ; service start ( ) ; if ( is in state ( state started ) ) { / / if the service started ( and isn ' t now in a later state ) , notify log debug ( " service { } is started " , get name ( ) ) ; notify listeners ( ) ; } } catch ( exception e ) { note failure ( e ) ; service operations stop quietly ( log , this ) ; throw service state exception convert ( e ) ; } } } }


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


sets the name for the tool for this test integration

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


public static long get time span by now ( final long millis , @ time constants unit final int unit ) { return get time span ( millis , system current time millis ( ) , unit ) ; }


transitions from the alpha at the time this action starts to an alpha of 1

static public alpha action fade in ( float duration , @ null interpolation interpolation ) { alpha action action = action ( alpha action class ) ; action set alpha ( 1 ) ; action set duration ( duration ) ; action set interpolation ( interpolation ) ; return action ; }


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