generate the outfile name based on a given name and the input file name if the { @ link job context # map input file } does not exists ( i e this is not for a map only job ) , the given name is returned unchanged if the config value for " num of trailing legs to use " is not set , or set 0 or negative , the given name is returned unchanged otherwise , return a file name consisting of the n trailing legs of the input file name where n is the config value for " num of trailing legs to use "

protected string get input file based output file name ( job conf job , string name ) { string infilepath = job get ( m r job config map input file ) ; if ( infilepath = = null ) { / / if the { @ link job context # map input file } does not exists , / / then return the given name return name ; } int num of trailing legs to use = job get int ( " mapred outputformat num of trailing legs " , 0 ) ; if ( num of trailing legs to use < = 0 ) { return name ; } path infile = new path ( infilepath ) ; path parent = infile get parent ( ) ; string mid name = infile get name ( ) ; path out path = new path ( mid name ) ; for ( int i = 1 ; i < num of trailing legs to use ; i + + ) { if ( parent = = null ) break ; mid name = parent get name ( ) ; if ( mid name length ( ) = = 0 ) break ; parent = parent get parent ( ) ; out path = new path ( mid name , out path ) ; } return out path to string ( ) ; }


the id of the type this may be 0 , which indicates no id is set < code > optional uint 3 2 id = 1 ; < code >


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


gets the proto representation of the python user - defined table aggregate function to be executed

public flink fn api user defined aggregate functions get user defined functions proto ( ) { flink fn api user defined aggregate functions builder builder = super get user defined functions proto ( ) to builder ( ) ; return builder build ( ) ; }


upload the result of a locally executed action to the remote cache

public action result upload ( action key action key , action action , command command , path exec root , collection < path > outputs , file out err out err , int exit code ) throws exec exception , i o exception , interrupted exception { action result builder result builder = action result new builder ( ) ; upload outputs ( exec root , action key , action , command , outputs , out err , result builder ) ; result builder set exit code ( exit code ) ; action result result = result builder build ( ) ; if ( exit code = = 0 & & ! action get do not cache ( ) ) { cache protocol upload action result ( action key , result ) ; } return result ; }


if a trial license was started as a result of the request corresponding to this response ( see { @ link # is trial was started ( ) } ) then returns the type of license that was started on the cluster returns null otherwise

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


< code > required string message = 1 ; < code >


after all tests have run , close the filesystems

public static void close file systems ( ) { i o utils cleanup with logger ( log , auth f s , unguarded f s ) ; }


public final int get vertex count ( ) { return m count ; }


returns { @ code true } if { @ code elements } is a sorted collection using an ordering equivalent to { @ code comparator }

public static boolean has same comparator ( comparator < ? > comparator , iterable < ? > elements ) { check not null ( comparator ) ; check not null ( elements ) ; comparator < ? > comparator 2 ; if ( elements instanceof sorted set ) { comparator 2 = comparator ( ( sorted set < ? > ) elements ) ; } else if ( elements instanceof sorted iterable ) { comparator 2 = ( ( sorted iterable < ? > ) elements ) comparator ( ) ; } else { return false ; } return comparator equals ( comparator 2 ) ; }


public static cos n file system create test file system ( configuration configuration ) throws i o exception { string fs name = configuration get trimmed ( cos n test config key test cos filesystem conf key , cos n test config key default test cos filesystem conf value ) ; boolean live test = string utils is not empty ( fs name ) ; uri test uri ; if ( live test ) { test uri = uri create ( fs name ) ; live test = test uri get scheme ( ) equals ( cos n file system scheme ) ; } else { throw new assumption violated exception ( " no test file system in " + fs name ) ; } cos n file system cos fs = new cos n file system ( ) ; cos fs initialize ( test uri , configuration ) ; return cos fs ; }


replace all occurrences of a substring within a string with another string

public static string replace ( string in string , string old pattern , string new pattern ) { if ( ! has length ( in string ) | | ! has length ( old pattern ) | | new pattern = = null ) { return in string ; } string builder sb = new string builder ( ) ; int pos = 0 ; / / our position in the old string int index = in string index of ( old pattern ) ; / / the index of an occurrence we ' ve found , or - 1 int pat len = old pattern length ( ) ; while ( index > = 0 ) { sb append ( in string substring ( pos , index ) ) ; sb append ( new pattern ) ; pos = index + pat len ; index = in string index of ( old pattern , pos ) ; } sb append ( in string substring ( pos ) ) ; / / remember to append any characters to the right of a match return sb to string ( ) ; }


adds one more { @ link node } to jenkins if a node of the same name already exists then that node will be replaced

public void add node ( node n ) throws i o exception { nodes add node ( n ) ; }


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


register a factory for type adapters registering a factory is useful when the type adapter needs to be configured based on the type of the field being processed gson is designed to handle a large number of factories , so you should consider registering them to be at par with registering an individual type adapter

public gson builder register type adapter factory ( type adapter factory factory ) { factories add ( factory ) ; return this ; }


get the default permission for directory

public static fs permission get dir default ( ) { return new fs permission ( ( short ) 00777 ) ; }


public map < string , object > handle ( ) { val model = new hash map < string , object > ( ) ; val diff = duration between ( this up time start date , zoned date time now ( zone offset utc ) ) ; model put ( " up time " , diff get seconds ( ) ) ; val runtime = runtime get runtime ( ) ; model put ( " total memory " , file utils byte count to display size ( runtime total memory ( ) ) ) ; model put ( " max memory " , file utils byte count to display size ( runtime max memory ( ) ) ) ; model put ( " free memory " , file utils byte count to display size ( runtime free memory ( ) ) ) ; val unexpired tgts = new atomic integer ( ) ; val unexpired sts = new atomic integer ( ) ; val expired tgts = new atomic integer ( ) ; val expired sts = new atomic integer ( ) ; val tickets = this central authentication service get tickets ( ticket - > true ) ; tickets for each ( ticket - > { if ( ticket instanceof service ticket ) { if ( ticket is expired ( ) ) { this central authentication service delete ticket ( ticket get id ( ) ) ; expired sts increment and get ( ) ; } else { unexpired sts increment and get ( ) ; } } else { if ( ticket is expired ( ) ) { this central authentication service delete ticket ( ticket get id ( ) ) ; expired tgts increment and get ( ) ; } else { unexpired tgts increment and get ( ) ; } } } ) ; model put ( " unexpired tgts " , unexpired tgts ) ; model put ( " unexpired sts " , unexpired sts ) ; model put ( " expired tgts " , expired tgts ) ; model put ( " expired sts " , expired sts ) ; return model ; }


create or update ticket granting ticket ticket granting ticket

protected ticket granting ticket create or update ticket granting ticket ( final authentication result authentication result , final authentication authentication , final string ticket granting ticket ) { try { if ( should issue ticket granting ticket ( authentication , ticket granting ticket ) ) { if ( string utils is not blank ( ticket granting ticket ) ) { logger trace ( " removing existing ticket - granting ticket [ { } ] " , ticket granting ticket ) ; webflow event resolution configuration context get ticket registry ( ) delete ticket ( ticket granting ticket ) ; } logger trace ( " attempting to issue a new ticket - granting ticket " ) ; return webflow event resolution configuration context get central authentication service ( ) create ticket granting ticket ( authentication result ) ; } logger debug ( " updating the existing ticket - granting ticket [ { } ] " , ticket granting ticket ) ; val tgt = webflow event resolution configuration context get central authentication service ( ) get ticket ( ticket granting ticket , ticket granting ticket class ) ; tgt get authentication ( ) update ( authentication ) ; webflow event resolution configuration context get central authentication service ( ) update ticket ( tgt ) ; return tgt ; } catch ( final principal exception e ) { logging utils error ( logger , e ) ; throw e ; } catch ( final exception e ) { logging utils error ( logger , e ) ; throw new invalid ticket exception ( ticket granting ticket ) ; } }


returns a new address in this address ' s space with the given offset note : for those spaces with an addressable unit size other than 1 , the address returned may not correspond to an addressable unitword boundary if a byte - offset is specified

address get new address ( long offset , boolean is addressable word offset ) throws address out of bounds exception ;


tests if the given component is one of a known list of component classes that we don ' t ever want to get keyboard focus currently excluded is j scroll pane

static boolean exclude focus ( component c ) { return ( c instanceof j scroll pane ) | | ( c instanceof j scroll bar ) | | ( c instanceof j tabbed pane ) ; }


20 random tests of various record , file , and split sizes all tests have uncompressed file as input

public void test format ( ) throws exception { run random tests ( null ) ; }


move the image back to the center zoom factor is unmodified

public void reset image translation ( ) { label reset translation ( ) ; }


returns the current index of this object in the internal array of { @ link heap priority queue }


info , error , warn , callback method implementation

public void append ( log event event ) { if ( null = = producer ) { return ; } byte [ ] data = this get layout ( ) to byte array ( event ) ; try { message msg = new message ( topic , tag , data ) ; msg get properties ( ) put ( producer instance appender type , producer instance log4j2 appender ) ; / / send message and do not wait for the ack from the message broker producer send oneway ( msg ) ; } catch ( exception e ) { error handler handler = this get handler ( ) ; if ( handler ! = null ) { string msg = new string ( data ) ; handler error ( " could not send message in rocketmq log 4j 2 appender [ " + this get name ( ) + " ] message is : " + msg , e ) ; } } }


on version 5 4 the state doc ids had a different pattern the pattern started with the job id , followed by a hyphen , the snapshot id , and ended with hash and an integer

private static string v 5 4 extract job id ( string doc id ) { matcher matcher = v 5 4 doc id regex matcher ( doc id ) ; if ( matcher matches ( ) ) { return matcher group ( 1 ) ; } return null ; }


look up the entity manager factory that this filter should use the default implementation looks for a bean with the specified name in spring ' s root application context

protected entity manager factory lookup entity manager factory ( ) { web application context wac = web application context utils get required web application context ( get servlet context ( ) ) ; string emf bean name = get entity manager factory bean name ( ) ; string pu name = get persistence unit name ( ) ; if ( string utils has length ( emf bean name ) ) { return wac get bean ( emf bean name , entity manager factory class ) ; } else if ( ! string utils has length ( pu name ) & & wac contains bean ( default entity manager factory bean name ) ) { return wac get bean ( default entity manager factory bean name , entity manager factory class ) ; } else { / / includes fallback search for single entity manager factory bean by type return entity manager factory utils find entity manager factory ( wac , pu name ) ; } }


public object get actual instance ( ) { return instance ; }


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


add a block flow specified by a instruction block flow object these flows include all calls , branches and fall - throughs and may span across multiple instruction sets and are not used by the block flow iterator within the associated instruction set

public void add block flow ( instruction block flow block flow ) { if ( block flows = = null ) { block flows = new array list < instruction block flow > ( ) ; } block flows add ( block flow ) ; }


returns a { @ link assignment decision } whether the given persistent task can be assigned to a node of the cluster the decision depends on the current value of the setting { @ link enable assignment decider # cluster tasks allocation enable setting }

public assignment decision can assign ( ) { if ( enable assignment = = allocation none ) { return new assignment decision ( assignment decision type no , allocation none explanation ) ; } return assignment decision yes ; }


used to determine if the return value of { @ link byte buf # ensure writable ( int , boolean ) } means that there is adequate space and a write operation will succeed

public static boolean ensure writable success ( int ensure writable result ) { return ensure writable result = = 0 | | ensure writable result = = 2 ; }


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


starts a process that may persist its state

public void start ( executor service executor service , state processor state processor ) throws i o exception { start ( executor service ) ; assert process pipes get persist stream ( ) is present ( ) ; state processor future = executor service submit ( ( ) - > { try ( input stream in = process pipes get persist stream ( ) get ( ) ) { state processor process ( in ) ; if ( process killed = = false ) { logger info ( " [ { } ] state output finished " , job id ) ; } } catch ( i o exception e ) { if ( process killed = = false ) { logger error ( new parameterized message ( " [ { } ] error reading { } state output " , job id , get name ( ) ) , e ) ; } } } ) ; }


writes all the remaining chars of the { @ code src } char buffer to this buffer ' s current position , and increases both buffers ' position by the number of chars copied

public char buffer put ( char buffer src ) { if ( src = = this ) { throw new illegal argument exception ( ) ; } if ( src remaining ( ) > remaining ( ) ) { throw new buffer overflow exception ( ) ; } char [ ] contents = new char [ src remaining ( ) ] ; src get ( contents ) ; put ( contents ) ; return this ; }


creates a new big - endian direct buffer with the specified { @ code capacity } , which expands its capacity boundlessly on demand the new buffer ' s { @ code reader index } and { @ code writer index } are { @ code 0 }

public static byte buf direct buffer ( int initial capacity ) { return alloc direct buffer ( initial capacity ) ; }


a test where the blob cache must use the blob server and the connection fails too often which eventually fails the get request

private static void test blob fetch with too many failures ( final configuration config , final blob store blob store , @ nullable final job i d job id , blob key blob type blob type ) throws i o exception { final byte [ ] data = new byte [ ] { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 } ; try ( blob server server = new testing failing blob server ( config , blob store , 0 , 10 ) ; blob cache service cache = new blob cache service ( config , new void blob store ( ) , new inet socket address ( " localhost " , server get port ( ) ) ) ) { server start ( ) ; / / upload some blob final blob key key = put ( server , job id , data , blob type ) ; / / trigger a download - it should fail eventually try { verify contents ( cache , job id , key , data ) ; fail ( " this should fail " ) ; } catch ( i o exception e ) { / / as we expected } } }


creates { @ link validation exception } instance initialized with given error messages

public static validation exception with error ( string error ) { return with errors ( arrays as list ( error ) ) ; }


superimpose a line for 1d or dots for 2d to highlight the key features of the barcode

private void draw result points ( bitmap barcode , float scale factor , result raw result ) { result point [ ] points = raw result get result points ( ) ; if ( points ! = null & & points length > 0 ) { canvas canvas = new canvas ( barcode ) ; paint paint = new paint ( ) ; paint set color ( get resources ( ) get color ( r color result points ) ) ; if ( points length = = 2 ) { paint set stroke width ( 4 0f ) ; draw line ( canvas , paint , points [ 0 ] , points [ 1 ] , scale factor ) ; } else if ( points length = = 4 & & ( raw result get barcode format ( ) = = barcode format upc a | | raw result get barcode format ( ) = = barcode format ean 13 ) ) { / / hacky special case - - draw two lines , for the barcode and metadata draw line ( canvas , paint , points [ 0 ] , points [ 1 ] , scale factor ) ; draw line ( canvas , paint , points [ 2 ] , points [ 3 ] , scale factor ) ; } else { paint set stroke width ( 10 0f ) ; for ( result point point : points ) { if ( point ! = null ) { canvas draw point ( scale factor * point get x ( ) , scale factor * point get y ( ) , paint ) ; } } } } }


sets the alignment of the actor within the cell set to { @ link align # center } , { @ link align # top } , { @ link align # bottom } , { @ link align # left } , { @ link align # right } , or any combination of those

public cell < t > align ( int align ) { this align = align ; return this ; }


get overall starvation - fairshare and attributed minshare

resource get starvation ( ) { return resources add ( fairshare starvation , minshare starvation ) ; }


build vertices to represent an axis - aligned box

public void set as box ( float hx , float hy ) { jni set as box ( addr , hx , hy ) ; }


internal version of { @ link grpc negotiation handler }

public static channel handler grpc negotiation handler ( grpc http 2 connection handler next ) { return new grpc negotiation handler ( next ) ; }


fails the whole job graph due to task failure

void fail job due to task failure ( final throwable cause , final execution attempt i d failing task ) ;


private void check rpc headers ( rpc request header proto header ) throws rpc server exception { if ( ! header has rpc op ( ) ) { string err = " ipc server : no rpc op in rpc request header " ; throw new fatal rpc server exception ( rpc error code proto fatal invalid rpc header , err ) ; } if ( header get rpc op ( ) ! = rpc request header proto operation proto rpc final packet ) { string err = " ipc server does not implement rpc header operation " + header get rpc op ( ) ; throw new fatal rpc server exception ( rpc error code proto fatal invalid rpc header , err ) ; } / / if we know the rpc kind , get its class so that we can deserialize / / ( note it would make more sense to have the handler deserialize but / / we continue with this original design if ( ! header has rpc kind ( ) ) { string err = " ipc server : no rpc kind in rpc request header " ; throw new fatal rpc server exception ( rpc error code proto fatal invalid rpc header , err ) ; } }


closes the partition writer which releases the allocated resource , for example the buffer pool


visits an { @ link item } if it is a group , visits the children

public void on item ( item i ) { if ( i instanceof item group ) on item group ( ( item group ) i ) ; }


creates a null pointer exception with a composed message via { @ link # null warning ( string ) }

public static null pointer exception create null pointer exception ( string prefix ) { return new null pointer exception ( null warning ( prefix ) ) ; }


public long get in demand delay ( ) { return in demand delay ; }


gets an unsigned 16 - bit short integer at the specified absolute { @ code index } in this buffer in little endian byte order this method does not modify { @ code reader index } or { @ code writer index } of this buffer

public abstract int get unsigned short l e ( int index ) ;


given a set whose leaf successors are { @ link artifact } and { @ link expanded artifact } , returns a new nested set whose leaf successors are all expanded artifact non - leaf successors are unaltered

static nested set < ? > expand set ( completion context ctx , nested set < ? > artifacts ) { nested set builder < object > res = new nested set builder < > ( order stable order ) ; for ( object artifact : artifacts get leaves ( ) ) { if ( artifact instanceof expanded artifact ) { res add ( artifact ) ; } else if ( artifact instanceof artifact ) { ctx visit artifacts ( immutable list of ( ( artifact ) artifact ) , new artifact receiver ( ) { @ override public void accept ( artifact artifact ) { res add ( new expanded artifact ( artifact , null , null ) ) ; } @ override public void accept fileset mapping ( artifact fileset , path fragment rel name , path target file ) { res add ( new expanded artifact ( fileset , rel name , target file ) ) ; } } ) ; } else { throw new illegal state exception ( " unexpected type in artifact set : " + artifact ) ; } } boolean no directs = res is empty ( ) ; immutable list < ? extends nested set < ? > > non leaves = artifacts get non leaves ( ) ; for ( nested set < ? > succ : non leaves ) { res add transitive ( succ ) ; } nested set < ? > result = res build ( ) ; / / if we have executed one call to res add transitive ( x ) / / and none to res add , then res build ( ) simply returns x / / ( " inlining " ) , which may violate our postcondition on elements / / ( this can happen if ' artifacts ' contains one non - leaf successor / / and one or more leaf successors for which visit artifacts is a no - op ) / / / / in that case we need to recursively apply the expansion ugh if ( no directs & & non leaves size ( ) = = 1 ) { return expand set ( ctx , result ) ; } return result ; }


public int get max size ( ) { return this max size ; }


requests the peer to produce { @ code count } more messages to be delivered to the ' inbound ' { @ link stream observer } this method is safe to call from multiple threads without external synchronization

public abstract void request ( int count ) ;


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


hint method on whether this pattern matches everything or not

default boolean matches all ( ) { return false ; }


< code > merge code units < code > merges all instructions andor data ( as indicated ) in the specified address set from the origin program it merges them into the result program when merging instructions , the bytes are also replaced if they differ this assumes origin to result translator maps address spaces and does not do fine - grained mapping of addresses

public void merge code units ( address set view origin address set , address set view byte diffs , boolean merge data bytes , task monitor monitor ) throws memory access exception , cancelled exception , unsupported operation exception { if ( ! origin to result translator is one for one translator ( ) ) { string message = origin to result translator get class ( ) get name ( ) + " is not a one for one translator and can ' t merge code units " ; throw new unsupported operation exception ( message ) ; } monitor set message ( " applying code units " ) ; if ( origin address set is empty ( ) ) { return ; } program context origin context = origin program get program context ( ) ; program context result context = result program get program context ( ) ; register origin context reg = origin context get base context register ( ) ; register result context reg = result context get base context register ( ) ; / / expand ranges to keep delay - slots together within origin range / / may need to expand each range up or down origin address set = simple diff utility expand address set to include full delay slots ( origin program , origin address set ) ; / / don ' t clear instructions which match ( same instruction prototype ) so that references / / are preserved for ( address range origin range : origin address set get address ranges ( ) ) { / / get a new address set for this range that does not include any addresses where / / the origin and result instruction prototypes are the same / / the range address set will be used to clear code units address set range set = new address set ( origin range ) ; instruction iterator instructions = origin listing get instructions ( new address set ( origin range ) , true ) ; for ( instruction instruction : instructions ) { address result address = origin to result translator get address ( instruction get min address ( ) ) ; instruction result instruction = result listing get instruction at ( result address ) ; if ( ! should clear instruction ( instruction , result instruction ) ) { / / remove any instructions with matching prototypes , so they won ' t be cleared range set delete ( instruction get min address ( ) , instruction get max address ( ) ) ; } } / / clear the code units still in our range set for ( address range new origin range : range set get address ranges ( ) ) { address range result range = origin to result translator get address range ( new origin range ) ; / / clear any existing code units in the merged program / / where this code unit needs to go result listing clear code units ( result range get min address ( ) , result range get max address ( ) , false ) ; try { if ( result context reg ! = null ) { if ( origin context reg ! = null ) { / / copy context register value merge program context ( result context , origin context , origin context get base context register ( ) , new origin range , result range , monitor ) ; } else { / / clear context register value if it did not exist in original result context remove ( result range get min address ( ) , result range get max address ( ) , result context reg ) ; } } } catch ( context change exception e ) { msg error ( this , " unexpected exception : " + e get message ( ) , e ) ; } } } code unit iterator origin source code units = origin listing get code units ( origin address set , true ) ; / / get each code unit out of the iterator and set it in the merged / / program if it is an instruction for ( long count = 0 ; origin source code units has next ( ) & & ! monitor is cancelled ( ) ; count + + ) { monitor check canceled ( ) ; code unit origin code unit = origin source code units next ( ) ; if ( count = = progress counter granularity ) { monitor set message ( " applying code units " + origin code unit get address string ( true , false ) ) ; count = 0 ; } / / note : perform merge instruction ( ) and perform merge data ( ) / / clear the existing code units and then create a / / new instruction or data / / may cause the merge code unit to lose info attached / / to it if ( origin code unit instanceof instruction ) { instruction origin instruction = ( instruction ) origin code unit ; address result address = origin to result translator get address ( origin instruction get min address ( ) ) ; instruction result instruction = result listing get instruction at ( result address ) ; if ( result instruction = = null | | ! origin instruction get prototype ( ) equals ( result instruction get prototype ( ) ) ) { perform merge instruction ( origin instruction , byte diffs ) ; } else { copy instruction attributes ( origin instruction , result instruction ) ; } } else if ( origin code unit instanceof data ) { try { perform merge data ( ( data ) origin code unit , byte diffs , merge data bytes ) ; } catch ( code unit insertion exception e ) { info msg append ( " diff / merge can ' t apply data from " + origin code unit get min address ( ) + " " + e get message ( ) ) ; } } } }


read one record from the output topic and return its key and value as pair

public key value < k , v > read key value ( ) { final test record < k , v > record = read record ( ) ; return new key value < > ( record key ( ) , record value ( ) ) ; }


if the record has fields others than the primary keys this is used by test state store driver base to skip the modification check

public boolean has other fields ( ) { return true ; }


creates a mutable , initially empty { @ code hash set } instance < b > note : < b > if mutability is not required , use { @ link immutable set # of ( ) } instead if { @ code e } is an { @ link enum } type , use { @ link enum set # none of } instead otherwise , strongly consider using a { @ code linked hash set } instead , at the cost of increased memory footprint , to get deterministic iteration behavior < b > note for java 7 and later : < b > this method is now unnecessary and should be treated as deprecated instead , use the { @ code hash set } constructor directly , taking advantage of the new < a href = " http : goo gliz 2 wi " > " diamond " syntax

public static < e > hash set < e > new hash set ( ) { return new hash set < e > ( ) ; }


create all memory base segments within the specified range note : min address and max address must have the same address space !

private void create base segments ( address min address , address max address ) { long min base ; long max base ; if ( is in default address space ( min address ) ) { min base = get normalized offset ( min address ) & base mask ; max base = get normalized offset ( max address ) & base mask ; } else { min base = min address get offset ( ) & base mask ; max base = max address get offset ( ) & base mask ; } for ( long base = min base ; base < = max base ; base + = ( max offset + 1 ) ) { get base address index ( min address get new address ( base ) , false , index create ) ; } }


public path config file ( ) { return config file ; }


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


returns an iterator for the values in the map remove is supported if { @ link collections # allocate iterators } is false , the same iterator instance is returned each time this method is called use the { @ link entries } constructor for nested or multithreaded iteration

public values values ( ) { if ( collections allocate iterators ) return new values ( this ) ; if ( values 1 = = null ) { values 1 = new values ( this ) ; values 2 = new values ( this ) ; } if ( ! values 1 valid ) { values 1 reset ( ) ; values 1 valid = true ; values 2 valid = false ; return values 1 ; } values 2 reset ( ) ; values 2 valid = true ; values 1 valid = false ; return values 2 ; }


sets this matrix to an orthographic projection matrix with the origin at ( x , y ) extending by width and height , having a near and far plane

public matrix 4 set to ortho 2 d ( float x , float y , float width , float height , float near , float far ) { set to ortho ( x , x + width , y , y + height , near , far ) ; return this ; }


private download mission get pending mission ( stored file helper storage ) { for ( download mission mission : m missions pending ) { if ( mission storage equals ( storage ) ) { return mission ; } } return null ; }


increments the specified counter by the specified amount , creating it if it didn ' t already exist

public void incr counter ( string group , string counter , long amount ) { find counter ( group , counter ) increment ( amount ) ; }


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


partition metrics computes metrics at partition ( node label ) level sample jmx op structure : partition queue metrics ( label x ) metrics

private queue metrics get partition metrics ( string partition ) { string partition j m x str = partition ; if ( ( partition = = null ) | | ( partition equals ( r m node labels manager no label ) ) ) { partition = default partition ; partition j m x str = default partition jmx str ; } string metric name = partition + metric name delimiter ; queue metrics metrics = get queue metrics ( ) get ( metric name ) ; if ( metrics = = null ) { metrics = new partition queue metrics ( metrics system , this queue name , null , false , this conf , partition ) ; / / register with the metrics systems if ( metrics system ! = null ) { metrics system register ( p source name ( partition j m x str ) to string ( ) , " metrics for partition : " + partition j m x str , ( partition queue metrics ) metrics tag ( partition info , partition j m x str ) ) ; } get queue metrics ( ) put ( metric name , metrics ) ; } return metrics ; }


update application ' s blacklist with addition or removal resources

public void update blacklist ( list < string > blacklist additions , list < string > blacklist removals ) { client update blacklist ( blacklist additions , blacklist removals ) ; }


updates the gui display of the minimum alignment value

public void refresh g u i minimum alignment value ( ) { int minimum alignment = ( ( comp editor model ) model ) get minimum alignment ( ) ; string value = min align value text field get text ( ) ; boolean empty value = ( value length ( ) = = 0 ) ; boolean not by value = ( ( comp editor model ) model ) view composite is default aligned ( ) | | ( ( comp editor model ) model ) view composite is machine aligned ( ) ; if ( not by value ) { if ( ! empty value ) { min align value text field set text ( " " ) ; } return ; / / no value displayed since default or machine } / / change the display to the correct value string minimum alignment str = model show hex numbers ? composite viewer model get hex string ( minimum alignment , true ) : integer to string ( minimum alignment ) ; min align value text field set text ( minimum alignment str ) ; }


visits an instruction which has a branch target argument

public void visit branch ( int opcode , int offset , int length , int target ) ;


returns { @ code true } if { @ code subject } ends with { @ code suffix }

private static boolean ends with ( byte [ ] subject , byte [ ] suffix ) { int start = subject length - suffix length ; if ( start < 0 ) { return false ; } for ( int i = start ; i < subject length ; i + + ) { if ( subject [ i ] ! = suffix [ i - start ] ) { return false ; } } return true ; }


calls { @ link # act ( float ) } with { @ link graphics # get delta time ( ) } , limited to a minimum of 3 0fps

public void act ( ) { act ( math min ( gdx graphics get delta time ( ) , 1 / 3 0f ) ) ; }


public abstract prepared prepare ( long min utc millis , long max utc millis ) ;


set whether or not version conflicts cause the action to abort

public self abort on version conflict ( boolean abort on version conflict ) { request set abort on version conflict ( abort on version conflict ) ; return self ( ) ; }


resets the internal state of this byte matcher so that it can be reused against another byte stream


public void set icon ( drawable icon ) { this m icon = icon ; }


while walking the op tpl ' s in order , follow a particular build directive into its respective constructor and contruct tpl use pop build to backtrack

public void push build ( int buildnum ) { point = point get sub state ( buildnum ) ; depth + = 1 ; breadcrumb [ depth ] = 0 ; setup point ( ) ; }


handle the model for the ' additional properties ' keyword in the oas schema

protected void add addition properties to code gen model ( codegen model codegen model , schema schema ) { add parent container ( codegen model , codegen model name , schema ) ; }


sets the text field to the given value taking into account the current configuation

private void update text field ( big integer value ) { string text = compute text for value ( value ) ; text field set text ( text ) ; }


test that callback handlers are only applied to connections for the mechanisms configured for the handler test enables two mechanisms ' plain ` and ` digest - md5 ` on the servers with different callback handlers for the two mechanisms verifies that clients using both mechanisms authenticate successfully

public void test authenticate callback handler mechanisms ( ) throws exception { security protocol security protocol = security protocol sasl plaintext ; test jaas config jaas config = configure mechanisms ( " digest - md5 " , arrays as list ( " digest - md5 " , " plain " ) ) ; / / connections should fail using the digest callback handler if listener mechanism prefix not specified sasl server configs put ( " plain " + broker security configs sasl server callback handler class , test server callback handler class ) ; sasl server configs put ( " digest - md 5 " + broker security configs sasl server callback handler class , digest server callback handler class ) ; server = create echo server ( security protocol ) ; create and check client connection failure ( security protocol , " invalid " ) ; / / connections should succeed using the server callback handler associated with the listener listener name listener = listener name for security protocol ( security protocol ) ; sasl server configs remove ( " plain " + broker security configs sasl server callback handler class ) ; sasl server configs remove ( " digest - md 5 " + broker security configs sasl server callback handler class ) ; sasl server configs put ( listener sasl mechanism config prefix ( " plain " ) + broker security configs sasl server callback handler class , test server callback handler class ) ; sasl server configs put ( listener sasl mechanism config prefix ( " digest - md 5 " ) + broker security configs sasl server callback handler class , digest server callback handler class ) ; server = create echo server ( security protocol ) ; / / verify that digest - md5 ( currently configured for client ) works with ` digest server callback handler ` create and check client connection ( security protocol , " good - digest - md 5 " ) ; / / verify that plain works with ` test server callback handler ` jaas config set client options ( " plain " , test server callback handler username , test server callback handler password ) ; sasl client configs put ( sasl configs sasl mechanism , " plain " ) ; create and check client connection ( security protocol , " good - plain " ) ; }


sets the trust store key type the ca key generated for the test context will be of this type

public builder set trust store key type ( x 5 0 9 key type key type ) { trust store key type = key type ; return this ; }


public void test dog all of ( ) { / / todo : test dog all of }


if a response from a node includes a non - zero throttle delay and client - side throttling has been enabled for the connection to the node , throttle the connection for the specified delay

private void maybe throttle ( abstract response response , short api version , string node id , long now ) { int throttle time ms = response throttle time ms ( ) ; if ( throttle time ms > 0 & & response should client throttle ( api version ) ) { connection states throttle ( node id , now + throttle time ms ) ; log trace ( " connection to node { } is throttled for { } ms until timestamp { } " , node id , throttle time ms , now + throttle time ms ) ; } }


loads an object that represents difference between two immutable open maps of diffable objects using diffable proto object

public static < k , t extends diffable < t > > map diff < k , t , immutable open map < k , t > > read immutable open map diff ( stream input in , key serializer < k > key serializer , diffable value reader < k , t > diffable value reader ) throws i o exception { return new immutable open map diff < > ( in , key serializer , diffable value reader ) ; }


this unit test should correctly return the { @ link abstract event } class type when calling the { @ link abstract event # get type ( ) get type } method

public void test get event type ( ) { var user = new user ( " iluwatar " ) ; var user created event = new user created event ( user ) ; assert equals ( user created event class , user created event get type ( ) ) ; }


finds an avatar image url string for a user this method is called when a web page is going to show an avatar for a { @ link user } when multiple resolvers are installed , they are consulted in order and the search will be over when an avatar is found by someone since { @ link user avatar resolver } is singleton , this method can be invoked concurrently from multiple threads

public abstract string find avatar for ( user u , int width , int height ) ;


returns the address set that makes up all the instructions contained in this set

public address set view get address set ( ) { return address set ; }


returns true if test marked as " external " by the appropriate keyword in the tags attribute method assumes that passed target is a test rule , so usually it should be used only after is test rule ( ) or is test or test suite rule ( ) behavior is undefined otherwise

public static boolean is external test rule ( rule rule ) { return has constraint ( rule , " external " ) ; }


inspect the current authentication to validate the current requested context

pair < boolean , optional < t > > validate authentication context ( assertion assertion , http servlet request request ) ;


prepares the texture data for a call to { @ link # consume cubemap data ( ) } this method can be called from a non open g l thread and should thus not interact with open g l


public static m d 5 hash digest ( string string ) { return digest ( utf8 get bytes ( string ) ) ; }


public void do rss changelog ( stapler request req , stapler response rsp ) throws i o exception , servlet exception { class feed item { change log set entry e ; int idx ; public feed item ( change log set entry e , int idx ) { this e = e ; this idx = idx ; } run < ? , ? > get build ( ) { return e get parent ( ) build ; } } list < feed item > entries = new array list < > ( ) ; string scm display name = " " ; if ( this instanceof s c m trigger item ) { s c m trigger item scm item = ( s c m trigger item ) this ; list < string > scm names = new array list < > ( ) ; for ( scm s : scm item get s c ms ( ) ) { scm names add ( s get descriptor ( ) get display name ( ) ) ; } scm display name = " " + util join ( scm names , " , " ) ; } for ( run t r = get last build ( ) ; r ! = null ; r = r get previous build ( ) ) { int idx = 0 ; if ( r instanceof run with s c m ) { for ( change log set < ? extends change log set entry > c : ( ( run with s c m < ? , ? > ) r ) get change sets ( ) ) { for ( change log set entry e : c ) { entries add ( new feed item ( e , idx + + ) ) ; } } } } rss forward to rss ( get display name ( ) + scm display name + " changes " , get url ( ) + " changes " , entries , new feed adapter < feed item > ( ) { public string get entry title ( feed item item ) { return " # " + item get build ( ) number + ' ' + item e get msg ( ) + " ( " + item e get author ( ) + " ) " ; } public string get entry url ( feed item item ) { return item get build ( ) get url ( ) + " changes # detail " + item idx ; } public string get entry i d ( feed item item ) { return get entry url ( item ) ; } public string get entry description ( feed item item ) { string builder buf = new string builder ( ) ; for ( string path : item e get affected paths ( ) ) buf append ( path ) append ( ' \ n ' ) ; return buf to string ( ) ; } public calendar get entry timestamp ( feed item item ) { return item get build ( ) get timestamp ( ) ; } public string get entry author ( feed item entry ) { return jenkins location configuration get ( ) get admin address ( ) ; } } , req , rsp ) ; }


resolve continuation options according to the table in ' analyze headless r e a d m e html ' ( see " multiple scripts " section )

private void resolve continuation option with ( headless continuation option opt ) { if ( opt = = null ) { return ; } switch ( current option ) { case continue : current option = opt ; break ; case continue then delete : switch ( opt ) { case abort : case abort and delete : current option = headless continuation option abort and delete ; break ; default : break ; } break ; case abort and delete : / / nothing changes break ; case abort : / / nothing changes break ; } }


lists the application attempts matching the given applicationid

private void list application attempts ( string application id ) throws yarn exception , i o exception { print writer writer = new print writer ( new output stream writer ( sysout , charset for name ( " utf - 8 " ) ) ) ; list < application attempt report > app attempts report = client get application attempts ( application id from string ( application id ) ) ; writer println ( " total number of application attempts " + " : " + app attempts report size ( ) ) ; writer printf ( application attempts pattern , " application attempt - id " , " state " , " am - container - id " , " tracking - url " ) ; for ( application attempt report app attempt report : app attempts report ) { writer printf ( application attempts pattern , app attempt report get application attempt id ( ) , app attempt report get yarn application attempt state ( ) , app attempt report get a m container id ( ) = = null ? " n / a " : app attempt report get a m container id ( ) to string ( ) , app attempt report get tracking url ( ) ) ; } writer flush ( ) ; }


returns the private files system associated with this project file manager

public file system get private file system ( ) { return file system ; }


determine if the supplied object is equal to this { @ code merged context configuration } instance by comparing both object ' s { @ linkplain # get locations ( ) locations } , { @ linkplain # get classes ( ) annotated classes } , { @ linkplain # get context initializer classes ( ) context initializer classes } , { @ linkplain # get active profiles ( ) active profiles } , { @ linkplain # get property source locations ( ) property source locations } , { @ linkplain # get property source properties ( ) property source properties } , { @ linkplain # get parent ( ) parents } , and the fully qualified names of their { @ link # get context loader ( ) context loaders }

public boolean equals ( @ nullable object other ) { if ( this = = other ) { return true ; } if ( other = = null | | other get class ( ) ! = get class ( ) ) { return false ; } merged context configuration other config = ( merged context configuration ) other ; if ( ! arrays equals ( this locations , other config locations ) ) { return false ; } if ( ! arrays equals ( this classes , other config classes ) ) { return false ; } if ( ! this context initializer classes equals ( other config context initializer classes ) ) { return false ; } if ( ! arrays equals ( this active profiles , other config active profiles ) ) { return false ; } if ( ! arrays equals ( this property source locations , other config property source locations ) ) { return false ; } if ( ! arrays equals ( this property source properties , other config property source properties ) ) { return false ; } if ( ! this context customizers equals ( other config context customizers ) ) { return false ; } if ( this parent = = null ) { if ( other config parent ! = null ) { return false ; } } else if ( ! this parent equals ( other config parent ) ) { return false ; } if ( ! null safe class name ( this context loader ) equals ( null safe class name ( other config context loader ) ) ) { return false ; } return true ; }


returns an { @ link immutable sorted set } containing the same values in the given domain { @ linkplain range set # contains contained } by this range set < b > note : < b > { @ code a as set ( d ) equals ( b as set ( d ) ) } does not imply { @ code a equals ( b ) } ! for example , { @ code a } and { @ code b } could be { @ code [ 2 4 ] } and { @ code ( 1 5 ) } , or the empty ranges { @ code [ 3 3 ) } and { @ code [ 4 4 ) } < b > warning : < b > be extremely careful what you do with the { @ code as set } view of a large range set ( such as { @ code immutable range set of ( range greater than ( 0 ) ) } ) certain operations on such a set can be performed efficiently , but others ( such as { @ link set # hash code } or { @ link collections # frequency } ) can cause major performance problems the returned set ' s { @ link object # to string } method returns a short - hand form of the set ' s contents , such as { @ code " [ 1 100 ] } " }

public immutable sorted set < c > as set ( discrete domain < c > domain ) { check not null ( domain ) ; if ( is empty ( ) ) { return immutable sorted set of ( ) ; } range < c > span = span ( ) canonical ( domain ) ; if ( ! span has lower bound ( ) ) { / / according to the spec of canonical , neither this immutable range set nor / / the range have a lower bound throw new illegal argument exception ( " neither the discrete domain nor this range set are bounded below " ) ; } else if ( ! span has upper bound ( ) ) { try { domain max value ( ) ; } catch ( no such element exception e ) { throw new illegal argument exception ( " neither the discrete domain nor this range set are bounded above " ) ; } } return new as set ( domain ) ; }


get the full set of requirements for a tester class

public static tester requirements get tester requirements ( method tester method ) throws conflicting requirements exception { synchronized ( method tester requirements cache ) { tester requirements requirements = method tester requirements cache get ( tester method ) ; if ( requirements = = null ) { requirements = build tester requirements ( tester method ) ; method tester requirements cache put ( tester method , requirements ) ; } return requirements ; } }


called by a child node of the current node to increment a storage count lock is needed as different datanodes may call recursively to modify the same parent todo : this may not happen at all , depending on how heartheat is processed

public synchronized void child add storage ( string child name , storage type type ) { log debug ( " child add storage : { } : { } " , child name , type ) ; / / children storage info should definitely contain this node already / / because update storage is called after node added preconditions check argument ( children storage info contains key ( child name ) ) ; enum map < storage type , integer > type count = children storage info get ( child name ) ; if ( type count contains key ( type ) ) { type count put ( type , type count get ( type ) + 1 ) ; } else { / / please be aware that , the counts are always " number of datanodes in / / this subtree " rather than " number of storages in this storage " / / so if the caller is a datanode , it should always be this branch rather / / than the + 1 branch above this depends on the caller in / / datanode descriptor to make sure only when a * new * storage type is added / / it calls this ( should not call this when a already existing storage / / is added ) / / but no such restriction for inner nodes type count put ( type , 1 ) ; } if ( storage type counts contains key ( type ) ) { storage type counts put ( type , storage type counts get ( type ) + 1 ) ; } else { storage type counts put ( type , 1 ) ; } if ( get parent ( ) ! = null ) { ( ( d f s topology node impl ) get parent ( ) ) child add storage ( get name ( ) , type ) ; } }


handle odd addresses which may occur when jumpingreturning indirectly to thumb mode it is assumed that language will properly handle context changes during the flow of execution , we need only fix the current program counter

public void post execute callback ( emulate emulate , address last execute address , pcode op [ ] last execute pcode , int last pcode index , address current address ) throws lowlevel error { if ( t mode reg = = null ) { return ; } if ( last pcode index < 0 ) { / / ignore fall - through condition return ; } int last op = last execute pcode [ last pcode index ] get opcode ( ) ; if ( last op ! = pcode op branch & & last op ! = pcode op cbranch & & last op ! = pcode op branchind & & last op ! = pcode op call & & last op ! = pcode op callind & & last op ! = pcode op return ) { / / only concerned with branch , call or return ops return ; } long tb value = emu get memory state ( ) get value ( t breg ) ; if ( tb value = = 1 ) { / / thumb mode emu set context register value ( t mode ) ; / / change context to be consistent with tb value if ( ( current address get offset ( ) & 0x 1 ) = = 1 ) { emulate set execute address ( current address previous ( ) ) ; } } else if ( tb value = = 0 ) { if ( ( current address get offset ( ) & 0x 1 ) = = 1 ) { throw new lowlevel error ( " flow to odd address occurred without setting tb register ( thumb mode ) " ) ; } / / arm mode emu set context register value ( a mode ) ; / / change context to be consistent with tb value } }


prepares the legend and calculates all needed forms , labels and colors

public void compute legend ( chart data < ? > data ) { if ( ! m legend is legend custom ( ) ) { computed entries clear ( ) ; / / loop for building up the colors and labels used in the legend for ( int i = 0 ; i < data get data set count ( ) ; i + + ) { i data set data set = data get data set by index ( i ) ; if ( data set = = null ) continue ; list < integer > clrs = data set get colors ( ) ; int entry count = data set get entry count ( ) ; / / if we have a barchart with stacked bars if ( data set instanceof i bar data set & & ( ( i bar data set ) data set ) is stacked ( ) ) { i bar data set bds = ( i bar data set ) data set ; string [ ] s labels = bds get stack labels ( ) ; int min entries = math min ( clrs size ( ) , bds get stack size ( ) ) ; for ( int j = 0 ; j < min entries ; j + + ) { string label ; if ( s labels length > 0 ) { int label index = j % min entries ; label = label index < s labels length ? s labels [ label index ] : null ; } else { label = null ; } computed entries add ( new legend entry ( label , data set get form ( ) , data set get form size ( ) , data set get form line width ( ) , data set get form line dash effect ( ) , clrs get ( j ) ) ) ; } if ( bds get label ( ) ! = null ) { / / add the legend description label computed entries add ( new legend entry ( data set get label ( ) , legend legend form none , float na n , float na n , null , color template color none ) ) ; } } else if ( data set instanceof i pie data set ) { i pie data set pds = ( i pie data set ) data set ; for ( int j = 0 ; j < clrs size ( ) & & j < entry count ; j + + ) { computed entries add ( new legend entry ( pds get entry for index ( j ) get label ( ) , data set get form ( ) , data set get form size ( ) , data set get form line width ( ) , data set get form line dash effect ( ) , clrs get ( j ) ) ) ; } if ( pds get label ( ) ! = null ) { / / add the legend description label computed entries add ( new legend entry ( data set get label ( ) , legend legend form none , float na n , float na n , null , color template color none ) ) ; } } else if ( data set instanceof i candle data set & & ( ( i candle data set ) data set ) get decreasing color ( ) ! = color template color none ) { int decreasing color = ( ( i candle data set ) data set ) get decreasing color ( ) ; int increasing color = ( ( i candle data set ) data set ) get increasing color ( ) ; computed entries add ( new legend entry ( null , data set get form ( ) , data set get form size ( ) , data set get form line width ( ) , data set get form line dash effect ( ) , decreasing color ) ) ; computed entries add ( new legend entry ( data set get label ( ) , data set get form ( ) , data set get form size ( ) , data set get form line width ( ) , data set get form line dash effect ( ) , increasing color ) ) ; } else { / / all others for ( int j = 0 ; j < clrs size ( ) & & j < entry count ; j + + ) { string label ; / / if multiple colors are set for a data set , group them if ( j < clrs size ( ) - 1 & & j < entry count - 1 ) { label = null ; } else { / / add label to the last entry label = data get data set by index ( i ) get label ( ) ; } computed entries add ( new legend entry ( label , data set get form ( ) , data set get form size ( ) , data set get form line width ( ) , data set get form line dash effect ( ) , clrs get ( j ) ) ) ; } } } if ( m legend get extra entries ( ) ! = null ) { collections add all ( computed entries , m legend get extra entries ( ) ) ; } m legend set entries ( computed entries ) ; } typeface tf = m legend get typeface ( ) ; if ( tf ! = null ) m legend label paint set typeface ( tf ) ; m legend label paint set text size ( m legend get text size ( ) ) ; m legend label paint set color ( m legend get text color ( ) ) ; / / calculate all dimensions of the m legend m legend calculate dimensions ( m legend label paint , m view port handler ) ; }


sock js session create session ( string session id , web socket handler handler , map < string , object > attributes ) ;


groups by vertex and computes a group reduce transformation over the neighbors ( both edges and vertices ) of each vertex the neighbors function applied on the neighbors only has access to the vertex id ( not the vertex value ) of the grouping vertex for each vertex , the neighbors function can iterate over all neighbors of this vertex with the specified direction , and emit any number of output elements , including none

public < t > data set < t > group reduce on neighbors ( neighbors function < k , vv , ev , t > neighbors function , edge direction direction ) throws illegal argument exception { switch ( direction ) { case in : / / create < edge - source vertex > pairs data set < tuple 3 < k , edge < k , ev > , vertex < k , vv > > > edges with sources = edges join ( this vertices ) where ( 0 ) equal to ( 0 ) with ( new project vertex id join < > ( 1 ) ) with forwarded fields first ( " f 1 - > f 0 " ) name ( " edge with source vertex id " ) ; return edges with sources group by ( 0 ) reduce group ( new apply neighbor group reduce function < > ( neighbors function ) ) name ( " neighbors function " ) ; case out : / / create < edge - target vertex > pairs data set < tuple 3 < k , edge < k , ev > , vertex < k , vv > > > edges with targets = edges join ( this vertices ) where ( 1 ) equal to ( 0 ) with ( new project vertex id join < > ( 0 ) ) with forwarded fields first ( " f 0 " ) name ( " edge with target vertex id " ) ; return edges with targets group by ( 0 ) reduce group ( new apply neighbor group reduce function < > ( neighbors function ) ) name ( " neighbors function " ) ; case all : / / create < edge - source or target vertex > pairs data set < tuple 3 < k , edge < k , ev > , vertex < k , vv > > > edges with neighbors = edges flat map ( new emit one edge with neighbor per node < > ( ) ) name ( " forward and reverse edges " ) join ( this vertices ) where ( 1 ) equal to ( 0 ) with ( new project edge with neighbor < > ( ) ) name ( " edge with vertex id " ) ; return edges with neighbors group by ( 0 ) reduce group ( new apply neighbor group reduce function < > ( neighbors function ) ) name ( " neighbors function " ) ; default : throw new illegal argument exception ( " illegal edge direction " ) ; } }


tests that { @ link abstract heap state } instances respect the queryable flag and create concurrent variants for internal state structures

protected void test concurrent map if queryable ( ) throws exception { final int number of key groups = 1 ; final abstract keyed state backend < integer > backend = create keyed backend ( int serializer instance , number of key groups , new key group range ( 0 , 0 ) , new dummy environment ( ) ) ; { / / value state value state descriptor < integer > desc = new value state descriptor < > ( " value - state " , integer class , - 1 ) ; desc set queryable ( " my - query " ) ; value state < integer > state = backend get partitioned state ( void namespace instance , void namespace serializer instance , desc ) ; internal kv state < integer , void namespace , integer > kv state = ( internal kv state < integer , void namespace , integer > ) state ; assert true ( kv state instanceof abstract heap state ) ; kv state set current namespace ( void namespace instance ) ; backend set current key ( 1 ) ; state update ( 121818273 ) ; state table < ? , ? , ? > state table = ( ( abstract heap state < ? , ? , ? > ) kv state ) get state table ( ) ; check concurrent state table ( state table , number of key groups ) ; } { / / list state list state descriptor < integer > desc = new list state descriptor < > ( " list - state " , integer class ) ; desc set queryable ( " my - query " ) ; list state < integer > state = backend get partitioned state ( void namespace instance , void namespace serializer instance , desc ) ; internal kv state < integer , void namespace , integer > kv state = ( internal kv state < integer , void namespace , integer > ) state ; assert true ( kv state instanceof abstract heap state ) ; kv state set current namespace ( void namespace instance ) ; backend set current key ( 1 ) ; state add ( 121818273 ) ; state table < ? , ? , ? > state table = ( ( abstract heap state < ? , ? , ? > ) kv state ) get state table ( ) ; check concurrent state table ( state table , number of key groups ) ; } { / / reducing state reducing state descriptor < integer > desc = new reducing state descriptor < > ( " reducing - state " , new reduce function < integer > ( ) { @ override public integer reduce ( integer value 1 , integer value 2 ) throws exception { return value 1 + value 2 ; } } , integer class ) ; desc set queryable ( " my - query " ) ; reducing state < integer > state = backend get partitioned state ( void namespace instance , void namespace serializer instance , desc ) ; internal kv state < integer , void namespace , integer > kv state = ( internal kv state < integer , void namespace , integer > ) state ; assert true ( kv state instanceof abstract heap state ) ; kv state set current namespace ( void namespace instance ) ; backend set current key ( 1 ) ; state add ( 121818273 ) ; state table < ? , ? , ? > state table = ( ( abstract heap state < ? , ? , ? > ) kv state ) get state table ( ) ; check concurrent state table ( state table , number of key groups ) ; } { / / map state map state descriptor < integer , string > desc = new map state descriptor < > ( " map - state " , integer class , string class ) ; desc set queryable ( " my - query " ) ; map state < integer , string > state = backend get partitioned state ( void namespace instance , void namespace serializer instance , desc ) ; internal kv state < integer , void namespace , map < integer , string > > kv state = ( internal kv state < integer , void namespace , map < integer , string > > ) state ; assert true ( kv state instanceof abstract heap state ) ; kv state set current namespace ( void namespace instance ) ; backend set current key ( 1 ) ; state put ( 121818273 , " 121818273 " ) ; int key group index = key group range assignment assign to key group ( 1 , number of key groups ) ; state table state table = ( ( abstract heap state ) kv state ) get state table ( ) ; assert not null ( " state not set " , state table get ( key group index ) ) ; check concurrent state table ( state table , number of key groups ) ; } backend dispose ( ) ; }


public boolean has exception handler ( ) { return ( this exception handler ! = null ) ; }


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


returns the set of common data types supported by the generator

public enum set < data type feature > get data type features ( ) { if ( data type features ! = null ) { return enum set copy of ( data type features ) ; } else { return enum set none of ( data type feature class ) ; } }


starts the execution of the program and returns an iterator to read the result of the given data stream , plus a { @ link job client } to interact with the application execution

public static < out > client and iterator < out > collect with client ( data stream < out > stream , string job execution name ) throws exception { return stream execute and collect with client ( job execution name ) ; }


public static < t extends throwable > t clear stack trace ( @ not null t throwable ) { throwable cause = throwable ; while ( cause ! = null ) { cause set stack trace ( empty stack trace ) ; cause = cause get cause ( ) ; } return throwable ; }


this is invoked without calling open ( ) in blink , so we need to call init ( ) for get new aggregation buffer ( ) todo : re - evaluate how this will fit into flink ' s new type inference and udf systemß

public generic u d a f evaluator aggregation buffer create accumulator ( ) { try { if ( ! initialized ) { init ( ) ; } return partial evaluator get new aggregation buffer ( ) ; } catch ( exception e ) { throw new flink hive u d f exception ( string format ( " failed to create accumulator for % s " , hive function wrapper get class name ( ) ) , e ) ; } }


overwrite another { @ link data resource }

data resource overwrite ( data resource other ) ;


test if we compute the maximum am resource correctly

public void test compute max a m resource ( ) throws i o exception { conf set ( fair scheduler configuration allocation file , alloc file ) ; allocation file writer create ( ) add queue ( new allocation file queue builder ( " queue f s zero with max " ) weight ( 0 ) max a m share ( 0 5 ) max resources ( " 4096 mb 4 vcores " ) build ( ) ) add queue ( new allocation file queue builder ( " queue f s zero with a v l " ) weight ( 0 0f ) max a m share ( 0 5 ) build ( ) ) add queue ( new allocation file queue builder ( " queue f s non zero " ) weight ( 1 ) max a m share ( 0 5 ) build ( ) ) drf default queue scheduling policy ( ) write to file ( alloc file ) ; scheduler init ( conf ) ; scheduler start ( ) ; scheduler reinitialize ( conf , resource manager get r m context ( ) ) ; long mem capacity = 20 * gb ; int cpu capacity = 20 ; r m node node = mock nodes new node info ( 1 , resources create resource ( mem capacity , cpu capacity ) , 0 , " 127 0 0 1 " ) ; node added scheduler event node event = new node added scheduler event ( node ) ; node update scheduler event update event = new node update scheduler event ( node ) ; scheduler handle ( node event ) ; scheduler update ( ) ; resource am resource = resource new instance ( 1 * gb , 1 ) ; int am priority = r m app attempt impl am container priority get priority ( ) ; / / queue f s zero with max f s leaf queue queue f s zero with max = scheduler get queue manager ( ) get leaf queue ( " queue f s zero with max " , true ) ; application attempt id att id 1 = create app attempt id ( 1 , 1 ) ; create application with a m resource ( att id 1 , " queue f s zero with max " , " user 1 " , am resource ) ; create scheduling request existing application ( 1 * gb , 1 , am priority , att id 1 ) ; scheduler update ( ) ; scheduler handle ( update event ) ; / / queue f s zero with max ' s weight is 0 0 , so its fair share should be 0 , we use / / the min ( max share , available resource ) to compute max a m share , in this / / case , we use max share , since it is smaller than available resource assert equals ( " queue f s zero with max ' s fair share should be zero " , 0 , queue f s zero with max get fair share ( ) get memory size ( ) ) ; resource expected a m resource = resources multiply and round up ( queue f s zero with max get max share ( ) , queue f s zero with max get max a m share ( ) ) ; assert equals ( " queue f s zero with max ' s maximum am resource should be " + " max share * max a m share " , expected a m resource get memory size ( ) , queue f s zero with max get metrics ( ) get max a m share m b ( ) ) ; assert equals ( " queue f s zero with max ' s maximum am resource should be " + " max share * max a m share " , expected a m resource get virtual cores ( ) , queue f s zero with max get metrics ( ) get max a m share v cores ( ) ) ; assert equals ( " queue f s zero with max ' s am resource usage should be the same to " + " am resource request " , am resource get memory size ( ) , queue f s zero with max get metrics ( ) get a m resource usage m b ( ) ) ; / / queue f s zero with a v l am resource = resources create resource ( 1 * gb , 1 ) ; f s leaf queue queue f s zero with a v l = scheduler get queue manager ( ) get leaf queue ( " queue f s zero with a v l " , true ) ; application attempt id att id 2 = create app attempt id ( 2 , 1 ) ; create application with a m resource ( att id 2 , " queue f s zero with a v l " , " user 1 " , am resource ) ; create scheduling request existing application ( 1 * gb , 1 , am priority , att id 2 ) ; scheduler update ( ) ; scheduler handle ( update event ) ; / / queue f s zero with a v l ' s weight is 0 0 , so its fair share is 0 , and we use / / the min ( max share , available resource ) to compute max a m share , in this / / case , we use available resource since it is smaller than the / / default max share expected a m resource = resources multiply and round up ( resources create resource ( mem capacity - am resource get memory size ( ) , cpu capacity - am resource get virtual cores ( ) ) , queue f s zero with a v l get max a m share ( ) ) ; assert equals ( " queue f s zero with a v l ' s fair share should be zero " , 0 , queue f s zero with a v l get fair share ( ) get memory size ( ) ) ; assert equals ( " queue f s zero with a v l ' s maximum am resource should be " + " available resource * max a m share " , expected a m resource get memory size ( ) , queue f s zero with a v l get metrics ( ) get max a m share m b ( ) ) ; assert equals ( " queue f s zero with a v l ' s maximum am resource should be " + " available resource * max a m share " , expected a m resource get virtual cores ( ) , queue f s zero with a v l get metrics ( ) get max a m share v cores ( ) ) ; assert equals ( " queue f s zero with max ' s am resource usage should be the same to " + " am resource request " , am resource get memory size ( ) , queue f s zero with a v l get metrics ( ) get a m resource usage m b ( ) ) ; / / queue f s non zero am resource = resources create resource ( 1 * gb , 1 ) ; f s leaf queue queue f s non zero = scheduler get queue manager ( ) get leaf queue ( " queue f s non zero " , true ) ; application attempt id att id 3 = create app attempt id ( 3 , 1 ) ; create application with a m resource ( att id 3 , " queue f s non zero " , " user 1 " , am resource ) ; create scheduling request existing application ( 1 * gb , 1 , am priority , att id 3 ) ; scheduler update ( ) ; scheduler handle ( update event ) ; / / queue f s non zero ' s weight is 1 , so its fair share is not 0 , and we use the / / fair share to compute max a m share assert not equals ( " queue f s non zero ' s fair share shouldn ' t be zero " , 0 , queue f s non zero get fair share ( ) get memory size ( ) ) ; expected a m resource = resources multiply and round up ( queue f s non zero get fair share ( ) , queue f s non zero get max a m share ( ) ) ; assert equals ( " queue f s non zero ' s maximum am resource should be " + " fair share * max a m share " , expected a m resource get memory size ( ) , queue f s non zero get metrics ( ) get max a m share m b ( ) ) ; assert equals ( " queue f s non zero ' s maximum am resource should be " + " fair share * max a m share " , expected a m resource get virtual cores ( ) , queue f s non zero get metrics ( ) get max a m share v cores ( ) ) ; assert equals ( " queue f s non zero ' s am resource usage should be the same to " + " am resource request " , am resource get memory size ( ) , queue f s non zero get metrics ( ) get a m resource usage m b ( ) ) ; }


public static void set ( string user id , user account user account ) { cache set ( user id , user account ) ; }


sets consecutive return values to be returned when the method is called e g : < pre class = " code " > < code class = " java " > when ( mock some method ( ) ) then return ( 1 , 2 , 3 ) ; < code > last return value in the sequence ( in example : 3 ) determines the behavior of further consecutive calls see examples in javadoc for { @ link mockito # when }

ongoing stubbing < t > then return ( t value , t values ) ;


add a client protocol mock for the proxy

private atomic integer add client mock ( string host , map < inet socket address , client protocol > proxy map ) throws exception { final atomic integer counter = new atomic integer ( 0 ) ; inet socket address inet socker addr = new inet socket address ( host , rpc port ) ; final client protocol cp mock = mock ( client protocol class ) ; when ( cp mock get stats ( ) ) then answer ( create answer ( counter , 1 ) ) ; proxy map put ( inet socker addr , cp mock ) ; return counter ; }


get the configured free marker { @ link object wrapper } , or the { @ linkplain object wrapper # default wrapper default wrapper } if none specified

protected object wrapper get object wrapper ( ) { object wrapper ow = obtain configuration ( ) get object wrapper ( ) ; version version = configuration default incompatible improvements ; return ( ow ! = null ? ow : new default object wrapper builder ( version ) build ( ) ) ; }


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


return { @ code " " } if string equals null

public static string null 2 length 0 ( final string s ) { return s = = null ? " " : s ; }


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


object send a sync request ( channel channel , object message ) throws i o exception , timeout exception ;


public map < variable reference expression , column handle > get assignments ( ) { return assignments ; }


simple test with image , edits , and inprogress edits

public void test current storage inspector ( ) throws i o exception { f s image transactional storage inspector inspector = new f s image transactional storage inspector ( ) ; storage directory mock dir = f s image test util mock storage directory ( name node dir type image and edits , false , " / foo / current / " + get image file name ( 123 ) , " / foo / current / " + get finalized edits file name ( 123 , 456 ) , " / foo / current / " + get image file name ( 456 ) , " / foo / current / " + get in progress edits file name ( 457 ) ) ; inspector inspect directory ( mock dir ) ; assert equals ( 2 , inspector found images size ( ) ) ; f s image file latest image = inspector get latest images ( ) get ( 0 ) ; assert equals ( 456 , latest image tx id ) ; assert same ( mock dir , latest image sd ) ; assert true ( inspector is upgrade finalized ( ) ) ; assert equals ( new file ( " / foo / current / " + get image file name ( 456 ) ) , latest image get file ( ) ) ; }


test the property ' prefix ns wrapped array '

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


public optional < replica query data source rule > find data source rule ( final string data source name ) { return optional of nullable ( data source rules get ( data source name ) ) ; }


sets the text size to be a fraction of the view ' s remaining height after its top and bottom padding have been subtracted equivalent to { @ code # set fractional text size ( fraction of height , false ) }

public void set fractional text size ( float fraction of height ) { set fractional text size ( fraction of height , false ) ; }


returns a new readonly char buffer based on the specified char sequence

public static char buffer new char buffer ( char sequence chseq ) { return new char sequence adapter ( chseq ) ; }


obtains the value of the attribute , expands all values , and returns the resulting list if the attribute does not exist or is not of type { @ link type # string list } , then this method throws an error

public immutable list < string > list ( string attr name ) { return list ( attr name , rule context attributes ( ) get ( attr name , type string list ) ) ; }


ensure that { @ link reconfigurable base # start reconfiguration task } unsets the property in its parent ' s configuration when the new value is null

public void test conf is unset async ( ) throws reconfiguration exception , i o exception , timeout exception , interrupted exception { final string property = " foo " ; final string value 1 = " value 1 " ; final configuration conf = new configuration ( ) ; conf set ( property , value 1 ) ; final configuration new conf = new configuration ( ) ; final reconfigurable base reconfigurable = make reconfigurable ( conf , new conf , arrays as list ( property ) ) ; / / kick off a reconfiguration task and wait until it completes reconfigurable start reconfiguration task ( ) ; generic test utils wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { return reconfigurable get reconfiguration task status ( ) stopped ( ) ; } } , 100 , 60000 ) ; assert null ( reconfigurable get conf ( ) get ( property ) ) ; }


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 void trace ( string path , string accept type , route route ) { add route ( http method trace , create route impl ( path , accept type , route ) ) ; }


sets the schema with field names and the types required this method overwrites existing fields added with { @ link # field ( string , data type ) }

public schema schema ( table schema schema ) { table schema clear ( ) ; last field = null ; for ( int i = 0 ; i < schema get field count ( ) ; i + + ) { field ( schema get field name ( i ) get ( ) , schema get field data type ( i ) get ( ) ) ; } return this ; }


public string read string lenenc ( ) { int length = ( int ) read int lenenc ( ) ; byte [ ] result = new byte [ length ] ; byte buf read bytes ( result ) ; return new string ( result ) ; }


get authentications ( key : authentication name , value : authentication )

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


creates list of users with given input array

public void create users with array input ( list < user > body ) throws api exception { create users with array input with http info ( body ) ; }


sets the charset with which the csv strings are written to the file if not specified , the output format uses the systems default character encoding

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


returns the max amount of time , in milliseconds , that the first unified server socket read ( ) operation should block for when trying to detect the client mode ( tls or plaintext ) defaults to { @ link x 5 0 9 util # default handshake detection timeout millis }

public int get ssl handshake timeout millis ( ) { try { s s l context and options ctx = get default s s l context and options ( ) ; return ctx get handshake detection timeout millis ( ) ; } catch ( s s l context exception e ) { log error ( " error creating ssl context and options " , e ) ; return default handshake detection timeout millis ; } catch ( exception e ) { log error ( " error parsing config property { } " , get ssl handshake detection timeout millis property ( ) , e ) ; return default handshake detection timeout millis ; } }


creates the md5 checksum for the given file

public static byte [ ] checksum ( file file ) throws i o exception { try { input stream in = new file input stream ( file ) ; byte [ ] buffer = new byte [ 2048 ] ; message digest complete = message digest get instance ( " md5 " ) ; try { int n ; do { n = in read ( buffer ) ; if ( n > 0 ) { complete update ( buffer , 0 , n ) ; } } while ( n ! = - 1 ) ; } finally { in close ( ) ; } return complete digest ( ) ; } catch ( no such algorithm exception ex ) { throw new i o exception ( " could not create checksum " + file , ex ) ; } }


sets the stream - id of this frame the stream - id must be positive

spdy stream frame set stream id ( int stream i d ) ;


protected void perform highlight ( highlight h , motion event e ) { if ( h = = null | | h equal to ( m last highlighted ) ) { m chart highlight value ( null , true ) ; m last highlighted = null ; } else { m chart highlight value ( h , true ) ; m last highlighted = h ; } }


sets the hostname verification behavior if null is provided , reverts the behavior to the default , otherwise explicitly sets hostname verification to true or false

public builder set hostname verification ( boolean hostname verification ) { this hostname verification = hostname verification ; return this ; }


public void set runnable ( ) { this should run set ( true ) ; }


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

public void delete order test ( ) throws api exception { string order id = null ; api delete order ( order id ) ; / / todo : test validations }


unit test for an invalid output directory from a mnemonic via a dep transition integration test for top - level transition in srctestshellintegration : starlark configurations test # test invalid mnemonic from transition top level has to be an integration test because the error is emitted in build tool

public void invalid mnemonic from dep transition ( ) throws exception { write allowlist file ( ) ; scratch file ( " test / transitions bzl " , " def impl ( settings , attr ) : " , " return { ' / / command line option : cpu ' : ' / / bad : cpu ' } " , " my transition = transition ( implementation = impl , inputs = [ ] , " , " outputs = [ ' / / command line option : cpu ' ] ) " ) ; scratch file ( " test / rules bzl " , " load ( ' / / test : transitions bzl ' , ' my transition ' ) " , " def impl ( ctx ) : " , " return [ ] " , " my rule = rule ( " , " implementation = impl , " , " cfg = my transition , " , " attrs = { " , " ' allowlist function transition ' : attr label ( " , " default = ' / / tools / allowlists / function transition allowlist ' , " , " ) , " , " } ) " ) ; scratch file ( " test / build " , " load ( ' / / test : rules bzl ' , ' my rule ' ) " , " my rule ( name = ' bottom ' ) " , " genrule ( name = ' test ' , srcs = [ ' : bottom ' ] , outs = [ ' out ' ] , cmd = ' touch $ @ ' ) " ) ; reporter remove handler ( fail fast handler ) ; assert that ( get configured target ( " / / test : test " ) ) is null ( ) ; assert contains event ( " output directory name ' / / bad : cpu ' specified by cpp configuration is invalid as part of a " + " path : must not contain / " ) ; }


given the latest group state and a conflicting change , decides which changes to carry forward and returns a new group change which could be empty titles , avatars , and other settings are carried forward if they are different last writer wins membership additions and removals also respect last writer wins and are removed if they have already been applied e g you add someone but they are already added membership additions will be altered to { @ link decrypted group change } promotes if someone has invited them since

public static decrypted group change builder resolve conflict ( decrypted group group state , decrypted group change conflicting change ) { decrypted group change builder result = decrypted group change new builder ( conflicting change ) ; resolve conflict ( group state , conflicting change , new decrypted group change actions builder change set modifier ( result ) ) ; return result ; }


public delete order oper resp spec ( consumer < response spec builder > resp spec customizer ) { resp spec customizer accept ( resp spec ) ; return this ; }


this instantiates the gl10 , gl11 and gl20 instances includes the check for certain devices that pretend to support gl11 but fuck up vertex buffer objects this includes the pixelflinger which segfaults when buffers are deleted as well as the motorola cliq and the samsung behold ii

protected void setup g l ( javax microedition khronos opengles gl10 gl ) { string version string = gl gl get string ( gl10 gl version ) ; string vendor string = gl gl get string ( gl10 gl vendor ) ; string renderer string = gl gl get string ( gl10 gl renderer ) ; gl version = new g l version ( application application type android , version string , vendor string , renderer string ) ; if ( config use g l 3 0 & & gl version get major version ( ) > 2 ) { if ( gl 3 0 ! = null ) return ; gl 2 0 = gl 3 0 = new android g l 3 0 ( ) ; gdx gl = gl 3 0 ; gdx gl 2 0 = gl 3 0 ; gdx gl 3 0 = gl 3 0 ; } else { if ( gl 2 0 ! = null ) return ; gl 2 0 = new android g l 2 0 ( ) ; gdx gl = gl 2 0 ; gdx gl 2 0 = gl 2 0 ; } gdx app log ( log tag , " ogl renderer : " + gl gl get string ( gl10 gl renderer ) ) ; gdx app log ( log tag , " ogl vendor : " + gl gl get string ( gl10 gl vendor ) ) ; gdx app log ( log tag , " ogl version : " + gl gl get string ( gl10 gl version ) ) ; gdx app log ( log tag , " ogl extensions : " + gl gl get string ( gl10 gl extensions ) ) ; }


print all of the thread ' s information and stack traces

public synchronized static void print thread info ( print stream stream , string title ) { final int stack depth = 20 ; boolean contention = thread bean is thread contention monitoring enabled ( ) ; long [ ] thread ids = thread bean get all thread ids ( ) ; stream println ( " process thread dump : " + title ) ; stream println ( thread ids length + " active threads " ) ; for ( long tid : thread ids ) { thread info info = thread bean get thread info ( tid , stack depth ) ; if ( info = = null ) { stream println ( " inactive " ) ; continue ; } stream println ( " thread " + get task name ( info get thread id ( ) , info get thread name ( ) ) + " : " ) ; thread state state = info get thread state ( ) ; stream println ( " state : " + state ) ; stream println ( " blocked count : " + info get blocked count ( ) ) ; stream println ( " waited count : " + info get waited count ( ) ) ; if ( contention ) { stream println ( " blocked time : " + info get blocked time ( ) ) ; stream println ( " waited time : " + info get waited time ( ) ) ; } if ( state = = thread state waiting ) { stream println ( " waiting on " + info get lock name ( ) ) ; } else if ( state = = thread state blocked ) { stream println ( " blocked on " + info get lock name ( ) ) ; stream println ( " blocked by " + get task name ( info get lock owner id ( ) , info get lock owner name ( ) ) ) ; } stream println ( " stack : " ) ; for ( stack trace element frame : info get stack trace ( ) ) { stream println ( " " + frame to string ( ) ) ; } } stream flush ( ) ; }


public boolean is triggered ( ) { return triggered ; }


obtain a new prototype instance for every call

public object get target ( ) throws beans exception { return new prototype instance ( ) ; }


generates a cache key from a map of values

protected static string generate mashup key ( final map < string , string > keys ) { string builder builder = new string builder ( ) ; for ( object value : keys values ( ) ) { if ( builder length ( ) > 0 ) { builder append ( " - " ) ; } builder append ( value ) ; } return builder to string ( ) ; }


tries to get a read only adapter for the database whose handle is passed to this method

static enum d b adapter find read only adapter ( d b handle handle ) throws version exception { try { return new enum d b adapter v 0 ( handle ) ; } catch ( version exception e ) { if ( ! e is upgradable ( ) ) { throw e ; } } return new enum d b adapter no table ( handle ) ; }


public long renew delegation token ( token < delegation token identifier > token ) throws invalid token , i o exception , interrupted exception { return token renew ( get conf ( ) ) ; }


apply the given configurer to this builder instance this can be useful for applying pre - packaged customizations

builder apply ( web test client configurer configurer ) ;


public void map array anytype test ( ) { / / todo : test map array anytype }


compiles java source files and write to the pre - specified path to the output jar

path compile ( ) throws i o exception , source compilation exception { path compilation std out = files create temp file ( " compilation stdout " , " txt " ) ; path compilation std err = files create temp file ( " compilation stderr " , " txt " ) ; path compiled root dir = files create temp directory ( " compilation prodout " ) ; immutable list < string > javac options = immutable list < string > builder ( ) add all ( custom javac options ) add ( " - d " + compiled root dir ) build ( ) ; final list < path > compiled files ; try ( output stream std out stream = files new output stream ( compilation std out ) ; output stream std err stream = files new output stream ( compilation std err ) ) { splitter splitter = splitter on ( " " ) trim results ( ) omit empty strings ( ) ; immutable list < string > compilation arguments = immutable list < string > builder ( ) add all ( splitter split ( string join ( " " , javac options ) ) ) add all ( source inputs stream ( ) map ( path : : to string ) collect ( collectors to list ( ) ) ) build ( ) ; compiler run ( null input stream ( ) , std out stream , std err stream , compilation arguments to array ( new string [ 0 ] ) ) ; int max depth = source inputs stream ( ) map to int ( path : : get name count ) max ( ) get as int ( ) ; try ( stream < path > output stream = files find ( compiled root dir , max depth , ( path , file attr ) - > true ) ) { compiled files = output stream collect ( collectors to list ( ) ) ; } try ( jar output stream jar output stream = new jar output stream ( files new output stream ( output jar ) ) ) { for ( path compiled file : compiled files ) { try ( input stream input stream = files new input stream ( compiled file ) ) { path in archival path = compiled root dir relativize ( compiled file ) ; jar entry jar entry = new jar entry ( in archival path to string ( ) ) ; jar output stream put next entry ( jar entry ) ; if ( ! files is directory ( compiled file ) ) { byte streams copy ( input stream , jar output stream ) ; } jar output stream close entry ( ) ; } } } } string compilation standard error message = new string ( files read all bytes ( compilation std err ) , charset default charset ( ) ) ; if ( ! compilation standard error message is empty ( ) ) { throw new source compilation exception ( compilation standard error message ) ; } return output jar ; }


set whether existing transactions should be validated before participating in them when participating in an existing transaction ( e g with propagation required or propagation supports encountering an existing transaction ) , this outer transaction ' s characteristics will apply even to the inner transaction scope validation will detect incompatible isolation level and read - only settings on the inner transaction definition and reject participation accordingly through throwing a corresponding exception default is " false " , leniently ignoring inner transaction settings , simply overriding them with the outer transaction ' s characteristics switch this flag to " true " in order to enforce strict validation

public final void set validate existing transaction ( boolean validate existing transaction ) { this validate existing transaction = validate existing transaction ; }


an optional query dsl defined query that can added as a filter on the top of the sql query

public to x content filter ( ) { return filter ; }


method which is called when the king is flirting to a queen

public boolean get flirted ( king king ) { return this is flirty & & king is happy & & ! king is drunk ; }


public void init ( application configuration application configuration ) throws module not found exception , provider not found exception , service not provided exception , cycle dependency exception , module config exception , module start exception { string [ ] module names = application configuration module list ( ) ; service loader < module define > module service loader = service loader load ( module define class ) ; service loader < module provider > module provider loader = service loader load ( module provider class ) ; linked list < string > module list = new linked list < > ( arrays as list ( module names ) ) ; for ( module define module : module service loader ) { for ( string module name : module names ) { if ( module name equals ( module name ( ) ) ) { module prepare ( this , application configuration get module configuration ( module name ) , module provider loader ) ; loaded modules put ( module name , module ) ; module list remove ( module name ) ; } } } / / finish prepare stage is in prepare stage = false ; if ( module list size ( ) > 0 ) { throw new module not found exception ( module list to string ( ) + " missing " ) ; } bootstrap flow bootstrap flow = new bootstrap flow ( loaded modules ) ; bootstrap flow start ( this ) ; bootstrap flow notify after completed ( ) ; }


public static map < string , string > parse query string ( string qs ) { if ( is empty ( qs ) ) { return new hash map < string , string > ( ) ; } return parse key value pair ( qs , " \ \ & " ) ; }


returns a string representation of the non - hidden explicitly or implicitly specified options ; option values are shell - escaped

public static string as shell escaped string ( options parsing result options ) { return as shell escaped string ( options as complete list of parsed options ( ) ) ; }


sets the number of shard copies that should be active for indices opening to return defaults to { @ link active shard count # default } , which will wait for one shard copy ( the primary ) to become active set this value to { @ link active shard count # all } to wait for all shards ( primary and all replicas ) to be active before returning otherwise , use { @ link active shard count # from ( int ) } to set this value to any non - negative integer , up to the number of copies per shard ( number of replicas + 1 ) , to wait for the desired amount of shard copies to become active before returning indices opening will only wait up until the timeout value for the number of shard copies to be active before returning check { @ link open index response # is shards acknowledged ( ) } to determine if the requisite shard copies were all started before returning or timing out

public freeze request wait for active shards ( active shard count wait for active shards ) { this wait for active shards = wait for active shards ; return this ; }


waits for the assignment to stabilize after the group rebalances you must call { @ link # prepare for rebalance ( ) } prior to the rebalance - triggering event before using this method to wait

public void wait for next stable assignment ( final long max wait ms ) throws interrupted exception { wait for condition ( ( ) - > num stable assignments ( ) > = next expected num stable assignments , max wait ms , ( ) - > " client did not reach " + next expected num stable assignments + " stable assignments on time , " + " num stable assignments was " + num stable assignments ( ) ) ; }


we use this instead of check success in airlift so we can propagate the error message and so that we throw a presto exception rather than an illegal argument exception

public static void check spill succeeded ( future spill in progress ) { try { get future value ( spill in progress ) ; } catch ( presto exception presto exception ) { throw new presto exception ( presto exception : : get error code , presto exception get message ( ) , presto exception ) ; } catch ( runtime exception runtime exception ) { throw new presto exception ( generic internal error , format ( " spilling failed : % s " , runtime exception get message ( ) ) , runtime exception ) ; } }


patch another - fakedummy : to test special tags to test special tags and operation id starting with number

default response entity < client > call 1 2 3test special tags ( @ api param ( value = " client model " , required = true ) @ valid @ request body client body ) { return get delegate ( ) call 1 2 3test special tags ( body ) ; }


returns acl bindings which match the provided filter this is a synchronous api designed for use with locally cached a c ls this method is invoked on the request thread while processing describe acls requests and should avoid time - consuming remote communication that may block request threads

iterable < acl binding > acls ( acl binding filter filter ) ;


performs a remove only if this graph is not in the process of an internal update

private void maybe perform remove ( callback c ) { if ( is internal update ( ) ) { / / / / ignore internal updates / / we have to know when a remover operation should update us vs our ' complete graph ' / / when the client calls our public api , we wish to update our ' complete graph ' , when / / we trigger a filter operation to remove content from us , we do not want to / / update the ' complete graph ' , as it stores those removed items for later / / retrieval / / return ; } c call ( ) ; }


dispatches a bad request for example , if a request is malformed it will be dispatched via this method with the cause of the bad request

void dispatch bad request ( rest channel channel , thread context thread context , throwable cause ) ;


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

public void get order by id test ( ) { long order id = null ; / / order response = api get order by id ( order id ) ; / / todo : test validations }


set the remote invocation executor to use for this exporter default is a default remote invocation executor a custom invocation executor can extract further context information from the invocation , for example user credentials

public void set remote invocation executor ( remote invocation executor remote invocation executor ) { this remote invocation executor = remote invocation executor ; }


add a map of the information of the event to the existing information map

public void add event info ( map < string , object > event info ) { this event info put all ( event info ) ; }


< code > required string declaring class protocol name = 2 ; < code > r p cs for a particular interface ( ie protocol ) are done using a ipc connection that is setup using rpc proxy the rpc proxy ' s has a declared protocol name that is sent form client to server at connection time each rpc call also sends a protocol name ( called declaring classprotocol name ) this name is usually the same as the connection protocol name except in some cases for example meta protocols such protocol info proto which get metainfo about the protocol reuse the connection but need to indicate that the actual protocol is different ( i e the protocol is protocol info proto ) since they reuse the connection ; in this case the declaring class protocol name field is set to the protocol info proto

public com google protobuf byte string get declaring class protocol name bytes ( ) { java lang object ref = declaring class protocol name ; if ( ref instanceof java lang string ) { com google protobuf byte string b = com google protobuf byte string copy from utf 8 ( ( java lang string ) ref ) ; declaring class protocol name = b ; return b ; } else { return ( com google protobuf byte string ) ref ; } }