public void symbol changed ( symbol symbol , int type , address addr , object affected obj , object old value , object new value ) { if ( record changes ) { / / only add the symbol id to the change set if it isn ' t a default symbol if ( ! symbol is dynamic ( ) ) { long symbol i d = symbol get i d ( ) ; ( ( program d b change set ) change set ) symbol changed ( symbol i d ) ; } if ( symbol instanceof variable symbol d b ) { namespace parent namespace = symbol get parent namespace ( ) ; if ( parent namespace instanceof function ) { function function = ( function ) parent namespace ; address entry point = function get entry point ( ) ; update change set ( entry point , entry point ) ; fire event ( new program change record ( docr function changed , entry point , entry point , function , null , null ) ) ; } } if ( addr ! = null ) { update change set ( addr , addr ) ; } } changed = true ; fire event ( new program change record ( type , addr , addr , affected obj , old value , new value ) ) ; }


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


compares the elements of the two given arrays

public static int compare ( int [ ] array 1 , int size 1 , int [ ] array 2 , int size 2 ) { int min size = math min ( size 1 , size 2 ) ; for ( int index = 0 ; index < min size ; index + + ) { if ( array 1 [ index ] < array 2 [ index ] ) { return - 1 ; } else if ( array 1 [ index ] > array 2 [ index ] ) { return 1 ; } } return size 1 < size 2 ? - 1 : size 1 = = size 2 ? 0 : 1 ; }


resolves { @ code path name } relative to the working directory note that this will not create any entity in the filesystem ; i e , the file that the object is describing may not exist in the filesystem

public path resolve ( path fragment path name ) { return working dir get relative ( path name ) ; }


create a schema builder for the specified type usually it will be simpler to use one of the variants like { @ link # string ( ) } or { @ link # struct ( ) } , but this form can be useful when generating schemas dynamically

public static schema builder type ( type type ) { return new schema builder ( type ) ; } / / primitive types


gets the code for this error used on the wire


test ( de ) serialization on all previous released versions

public void test serialization b w c ( ) throws i o exception { for ( version version : version utils all released versions ( ) ) { has child query builder test query = create test query builder ( ) ; assert serialization ( test query , version ) ; } }


enables integrating hamcrest matchers that match primitive < code > long < code > arguments note that { @ link # arg that } will not work with primitive < code > long < code > matchers due to < code > null pointer exception < code > auto - unboxing caveat < p > see examples in javadoc for { @ link mockito hamcrest } class

public static long long that ( matcher < long > matcher ) { report matcher ( matcher ) ; return 0 ; }


public void set min resource ( resource min resource ) { this min resource = min resource ; }


uses subchannel connected to default target

private pick result use fallback ( pick subchannel args args ) { / / todo ( creamsoup ) wait until lb is ready start fallback child policy ( ) ; subchannel picker picker = fallback child policy wrapper get picker ( ) ; if ( picker = = null ) { return pick result with no result ( ) ; } return picker pick subchannel ( args ) ; }


returns true if field corresponding to field i d is set ( has been assigned a value ) and false otherwise

public boolean is set ( fields field ) { if ( field = = null ) { throw new illegal argument exception ( ) ; } switch ( field ) { case success : return is set success ( ) ; } throw new illegal state exception ( ) ; }


returns a new { @ code closing future } pipeline step derived from the inputs by applying a combining function to their values the function can use a { @ link deferred closer } to capture objects to be closed when the pipeline is done if this combiner was returned by { @ link # when all succeed ( closing future , closing future , closing future , closing future , closing future ) } and any of the inputs fail , so will the returned step if the function throws a { @ code cancellation exception } , the pipeline will be cancelled if the function throws an { @ code execution exception } , the cause of the thrown { @ code execution exception } will be extracted and used as the failure of the derived step

public < u extends object > closing future < u > call ( final closing function 5 < v1 , v2 , v3 , v4 , v5 , u > function , executor executor ) { return call ( new combining callable < u > ( ) { @ override @ nullable decl public u call ( deferred closer closer , peeker peeker ) throws exception { return function apply ( closer , peeker get done ( future 1 ) , peeker get done ( future 2 ) , peeker get done ( future 3 ) , peeker get done ( future 4 ) , peeker get done ( future 5 ) ) ; } @ override public string to string ( ) { return function to string ( ) ; } } , executor ) ; }


the optional resource name < code > optional string name = 3 ; < code >

private void set name bytes ( com google protobuf byte string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 4 ; name = value to string utf 8 ( ) ; }


returns the response headers associated with the load must only be called after the load completed , failed , or was canceled

public map < string , list < string > > get response headers ( ) { return data source get last response headers ( ) ; }


clears the previously open domain object which has been closed

synchronized boolean clear domain object ( string pathname ) { domain object adapter doa = open domain objects get ( pathname ) ; if ( doa ! = null ) { open domain objects remove ( pathname ) ; return true ; } return false ; }


public v peek value ( ) { return values [ size - 1 ] ; }


public order place order ( @ valid order body ) ;


a timeout to wait if the index operation can ' t be performed immediately defaults to { @ code 1m }

public final request builder set timeout ( time value timeout ) { request timeout ( timeout ) ; return ( request builder ) this ; }


the total number of threads in the cluster

public long get threads ( ) { return threads ; }


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


indicates whether the response should contain the stored source for every hit

public search request builder set fetch source ( boolean fetch ) { source builder ( ) fetch source ( fetch ) ; return this ; }


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

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


get the { @ link reservations a c ls manager } to use to check for the reservation access on a user

reservations a c ls manager get reservations a c ls manager ( ) ;


webservers may set the initial window size to zero , which is a special case because it means that we have to flush headers immediately before any request body can be sent https : github comsquareokhttpissues 2 5 4 3

@ test public void peer sets zero flow control ( ) throws exception { peer set client ( true ) ; / / write the mocking script peer send frame ( ) settings ( new settings ( ) set ( initial window size , 0 ) ) ; peer accept frame ( ) ; / / ack peer send frame ( ) window update ( 0 , 10 ) ; / / increase the connection window size peer accept frame ( ) ; / / ping peer send frame ( ) ping ( true , await ping , 0 ) ; peer accept frame ( ) ; / / headers stream 3 peer send frame ( ) window update ( 3 , 5 ) ; peer accept frame ( ) ; / / data stream 3 " abcde " peer send frame ( ) window update ( 3 , 5 ) ; peer accept frame ( ) ; / / data stream 3 " fghi " peer play ( ) ; / / play it back http 2 connection connection = connect ( peer ) ; connection write ping and await pong ( ) ; / / ensure the settings have been received http 2 stream stream = connection new stream ( header entries ( " a " , " android " ) , true ) ; buffered sink sink = okio buffer ( stream get sink ( ) ) ; sink write utf 8 ( " abcdefghi " ) ; sink flush ( ) ; / / verify the peer received what was expected peer take frame ( ) ; / / ping in frame headers = peer take frame ( ) ; assert that ( headers type ) is equal to ( http 2 type headers ) ; in frame data 1 = peer take frame ( ) ; assert that ( data 1 type ) is equal to ( http 2 type data ) ; assert that ( data 1 stream id ) is equal to ( 3 ) ; assert array equals ( " abcde " get bytes ( utf 8 ) , data 1 data ) ; in frame data 2 = peer take frame ( ) ; assert that ( data 2 type ) is equal to ( http 2 type data ) ; assert that ( data 2 stream id ) is equal to ( 3 ) ; assert array equals ( " fghi " get bytes ( utf 8 ) , data 2 data ) ; }


public long get pet id ( ) { return pet id ; }


public static boolean is status bar light mode ( @ non null final activity activity ) { return is status bar light mode ( activity get window ( ) ) ; }


return the given millis - since - epoch formatted with this format

default string format millis ( long millis ) { zone id zone = zone ( ) ! = null ? zone ( ) : zone offset utc ; return format ( instant of epoch milli ( millis ) at zone ( zone ) ) ; }


returns whether the constant ' s class index has been set for this instance

public boolean has class index ( ) { return ( class index > = 0 ) ; }


exit a parse tree produced by the { @ code parenthesized expression } labeled alternative in { @ link sql base parser # primary expression }

void exit parenthesized expression ( sql base parser parenthesized expression context ctx ) ;


{ @ link hystrix collapser key } these metrics represent

public hystrix collapser key get collapser key ( ) { return collapser key ; }


assert that the given component contains the provided pattern

public litho view assert has visible text matching ( string pattern ) { assert that view tree ( ) has visible text matching ( pattern ) ; return this ; }


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


public api response < pet > get pet by id with http info ( long pet id ) throws api exception { http request builder local var request builder = get pet by id request builder ( pet id ) ; try { http response < input stream > local var response = member var http client send ( local var request builder build ( ) , http response body handlers of input stream ( ) ) ; if ( member var response interceptor ! = null ) { member var response interceptor accept ( local var response ) ; } if ( local var response status code ( ) / 100 ! = 2 ) { throw new api exception ( local var response status code ( ) , " get pet by id call received non - success response " , local var response headers ( ) , local var response body ( ) = = null ? null : new string ( local var response body ( ) read all bytes ( ) ) ) ; } return new api response < pet > ( local var response status code ( ) , local var response headers ( ) map ( ) , member var object mapper read value ( local var response body ( ) , new type reference < pet > ( ) { } ) ) ; } catch ( i o exception e ) { throw new api exception ( e ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; throw new api exception ( e ) ; } }


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


build an adapted m bean for the given bean instance , if possible the default implementation builds a jmx 1 2 standard m bean for the target ' s m bean m x bean interface in case of an aop proxy , delegating the interface ' s management operations to the proxy

protected dynamic m bean adapt m bean if possible ( object bean ) throws j m exception { class < ? > target class = aop utils get target class ( bean ) ; if ( target class ! = bean get class ( ) ) { class < ? > ifc = jmx utils get m x bean interface ( target class ) ; if ( ifc ! = null ) { if ( ! ifc is instance ( bean ) ) { throw new not compliant m bean exception ( " managed bean [ " + bean + " ] has a target class with an m x bean interface but does not expose it in the proxy " ) ; } return new standard m bean ( bean , ( ( class < object > ) ifc ) , true ) ; } else { ifc = jmx utils get m bean interface ( target class ) ; if ( ifc ! = null ) { if ( ! ifc is instance ( bean ) ) { throw new not compliant m bean exception ( " managed bean [ " + bean + " ] has a target class with an m bean interface but does not expose it in the proxy " ) ; } return new standard m bean ( bean , ( ( class < object > ) ifc ) ) ; } } } return null ; }


returns the { @ link constraint value info } for the given { @ link constraint setting info } , or { @ code null } if none exists

public constraint value info get ( constraint setting info constraint ) { / / first , check locally if ( constraints ( ) contains key ( constraint ) ) { return constraints ( ) get ( constraint ) ; } / / then , check the parent , directly to ignore defaults if ( parent ( ) ! = null ) { return parent ( ) get ( constraint ) ; } / / finally , since this constraint isn ' t set , fall back to the default return constraint default constraint value ( ) ; }


create a temporary output stream for this view this is typically used as ie workaround , for setting the content length header from the temporary stream before actually writing the content to the http response

protected byte array output stream create temporary output stream ( ) { return new byte array output stream ( output byte array initial size ) ; }


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


return a transaction object for the current transaction state the returned object will usually be specific to the concrete transaction manager implementation , carrying corresponding transaction state in a modifiable fashion this object will be passed into the other template methods ( e g do begin and do commit ) , either directly or as part of a default reactive transaction status instance the returned object should contain information about any existing transaction , that is , a transaction that has already started before the current { @ code get transaction } call on the transaction manager consequently , a { @ code do get transaction } implementation will usually look for an existing transaction and store corresponding state in the returned transaction object

protected abstract object do get transaction ( transaction synchronization manager synchronization manager ) throws transaction exception ;


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

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


this test case is more specific to internal

public void test when mover is already running before storage policy satisfier ( ) throws exception { }


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


writes the given int value ( 3 2bit , 4 bytes ) to the given position in little endian byte order this method ' s speed depends on the system ' s native byte order , and it is possibly slower than { @ link # put int ( int , int ) } for most cases ( such as transient storage in memory or serialization for io and network ) , it suffices to know that the byte order in which the value is written is the same as the one in which it is read , and { @ link # put int ( int , int ) } is the preferable choice

public final void put int little endian ( int index , int value ) { if ( little endian ) { put int ( index , value ) ; } else { put int ( index , integer reverse bytes ( value ) ) ; } }


public void merge ( int set other ) { if ( other instanceof bit int set ) { bit int set o = ( bit int set ) other ; ensure capacity ( bits get max ( o bits ) + 1 ) ; bits or ( bits , o bits ) ; } else if ( other instanceof list int set ) { list int set o = ( list int set ) other ; int sz = o ints size ( ) ; if ( sz > 0 ) { ensure capacity ( o ints get ( sz - 1 ) ) ; } for ( int i = 0 ; i < o ints size ( ) ; i + + ) { bits set ( bits , o ints get ( i ) , true ) ; } } else { int iterator iter = other iterator ( ) ; while ( iter has next ( ) ) { add ( iter next ( ) ) ; } } }


must be called at the end of each subclass ' s constructor this method performs the " real " initialization ; we can ' t put this in the constructor because , in the case where futures are already complete , we would not initialize the subclass before calling { @ link # collect value from non cancelled future } as this is called after the subclass is constructed , we ' re guaranteed to have properly initialized the subclass

final void init ( ) { / / corner case : list is empty if ( futures is empty ( ) ) { handle all completed ( ) ; return ; } / / note : if we ever want to use a custom executor here , have a look at combined future as we ' ll / / need to handle rejected execution exception if ( all must succeed ) { / / we need fail fast , so we have to keep track of which future failed so we can propagate / / the exception immediately / / register a listener on each future in the list to update the state of this future / / note that if all the futures on the list are done prior to completing this loop , the last / / call to add listener ( ) will callback to set one value ( ) , transitively call our cleanup / / listener , and set this futures to null / / this is not actually a problem , since the foreach only needs this futures to be non - null / / at the beginning of the loop int i = 0 ; for ( final listenable future < ? extends input t > future : futures ) { final int index = i + + ; future add listener ( new runnable ( ) { @ override public void run ( ) { try { if ( future is cancelled ( ) ) { / / clear futures prior to cancelling children this sets our own state but lets / / the input futures keep running , as some of them may be used elsewhere futures = null ; cancel ( false ) ; } else { collect value from non cancelled future ( index , future ) ; } } finally { / * * " null " means : there is no need to access ` futures ` again during * ` process completed ` because we ' re reading each value during a call to * handle one input done * / decrement count and maybe complete ( null ) ; } } } , direct executor ( ) ) ; } } else { / * * we ' ll call the user callback or collect the values only when all inputs complete , * regardless of whether some failed this lets us avoid calling expensive methods like * future get ( ) when we don ' t need to ( specifically , for when all complete ( ) call * ( ) ) , and it * lets all futures share the same listener * * we store ` local futures ` inside the listener because ` this futures ` might be nulled out by * the time the listener runs for the final future - - at which point we need to check all * inputs for exceptions * if * we ' re collecting values if we ' re not , then the listener doesn ' t * need access to the futures again , so we can just pass ` null ` * * todo ( b / 112550045 ) : allocating a single , cheaper listener is ( i think ) only an optimization * if we make some other optimizations , this one will no longer be necessary the optimization * could actually hurt in some cases , as it forces us to keep all inputs in memory until the * final input completes * / final immutable collection < ? extends future < ? extends input t > > local futures = collects values ? futures : null ; runnable listener = new runnable ( ) { @ override public void run ( ) { decrement count and maybe complete ( local futures ) ; } } ; for ( listenable future < ? extends input t > future : futures ) { future add listener ( listener , direct executor ( ) ) ; } } }


effectively returns { @ link # get num instances ( ) }

public int get num instances ( ) { return buffer limit ( ) * 4 / attributes vertex size ; }


return all the properties that can be changed at run time

collection < string > get reconfigurable properties ( ) ;


obtain the type converter from the bean factory that this bean runs in , if possible

protected type converter get default type converter ( ) { if ( this bean factory ! = null ) { return this bean factory get type converter ( ) ; } else { return super get default type converter ( ) ; } }


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

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


return true if this user was not the originally authenticated user , false otherwise

public boolean is run as ( ) { return authenticated user ! = null ; }


fetches the leader index metadata and history u u i ds for leader index shards from the remote cluster before fetching the index metadata , the remote cluster is checked for license compatibility with ccr if the remote cluster is not licensed for ccr , the { @ code on failure } consumer is is invoked otherwise , the specified consumer is invoked with the leader index metadata fetched from the remote cluster

public void check remote cluster license and fetch leader index metadata and history u u i ds ( final client client , final string cluster alias , final string leader index , final consumer < exception > on failure , final bi consumer < string [ ] , tuple < index metadata , data stream > > consumer ) { final cluster state request request = new cluster state request ( ) ; request clear ( ) ; request metadata ( true ) ; request indices ( leader index ) ; check remote cluster license and fetch cluster state ( client , cluster alias , client get remote cluster client ( cluster alias ) , request , on failure , remote cluster state response - > { cluster state remote cluster state = remote cluster state response get state ( ) ; final index metadata leader index metadata = remote cluster state get metadata ( ) index ( leader index ) ; if ( leader index metadata = = null ) { final index abstraction index abstraction = remote cluster state get metadata ( ) get indices lookup ( ) get ( leader index ) ; final exception failure ; if ( index abstraction = = null ) { failure = new index not found exception ( leader index ) ; } else { / / provided name may be an alias or data stream and in that case throw a specific error : string message = string format ( locale root , " cannot follow [ % s ] , because it is a % s " , leader index , index abstraction get type ( ) ) ; failure = new illegal argument exception ( message ) ; } on failure accept ( failure ) ; return ; } if ( leader index metadata get state ( ) = = index metadata state close ) { on failure accept ( new index closed exception ( leader index metadata get index ( ) ) ) ; return ; } index abstraction index abstraction = remote cluster state get metadata ( ) get indices lookup ( ) get ( leader index ) ; final data stream remote data stream = index abstraction get parent data stream ( ) ! = null ? index abstraction get parent data stream ( ) get data stream ( ) : null ; final client remote client = client get remote cluster client ( cluster alias ) ; has privileges to follow indices ( remote client , new string [ ] { leader index } , e - > { if ( e = = null ) { fetch leader history u u i ds ( remote client , leader index metadata , on failure , history u u i ds - > consumer accept ( history u u i ds , tuple tuple ( leader index metadata , remote data stream ) ) ) ; } else { on failure accept ( e ) ; } } ) ; } , license check - > index metadata non compliant remote license ( leader index , license check ) , e - > index metadata unknown remote license ( leader index , cluster alias , e ) ) ; }


visit a parse tree produced by { @ link sql base parser # join type }

t visit join type ( sql base parser join type context ctx ) ;


scroll the view of the listing to the given location

public void scroll to ( program location location ) { field location field location = get field location ( location ) ; field panel scroll to ( field location ) ; }


public static map < string , object > as map ( final serializable properties , final filter provider filter provider ) { try ( val writer = new string writer ( ) ) { val mapper = new y a m l mapper ( ) ; mapper set filter provider ( filter provider ) ; mapper set serialization inclusion ( json include include non null ) ; mapper set property naming strategy ( property naming strategy kebab case ) ; val module = new simple module ( ) ; module add serializer ( resource class , new resource serializer ( ) ) ; mapper register module ( module ) ; mapper write value ( writer , properties ) ; val resource = new byte array resource ( writer to string ( ) get bytes ( standard charsets utf 8 ) ) ; return cas core configuration utils load yaml properties ( resource ) ; } }


enqueues new transactions at the transaction manager and returns a { @ link transactional request result } that allows waiting on them if there are no new transactions we return a { @ link transactional request result } that is already done

private transactional request result enqueue new partitions ( ) { object transaction manager = get field ( kafka producer , " transaction manager " ) ; synchronized ( transaction manager ) { object new partitions in transaction = get field ( transaction manager , " new partitions in transaction " ) ; object new partitions in transaction is empty = invoke ( new partitions in transaction , " is empty " ) ; transactional request result result ; if ( new partitions in transaction is empty instanceof boolean & & ! ( ( boolean ) new partitions in transaction is empty ) ) { object txn request handler = invoke ( transaction manager , " add partitions to transaction handler " ) ; invoke ( transaction manager , " enqueue request " , new class [ ] { txn request handler get class ( ) get superclass ( ) } , new object [ ] { txn request handler } ) ; result = ( transactional request result ) get field ( txn request handler , txn request handler get class ( ) get superclass ( ) , " result " ) ; } else { / / we don ' t have an operation but this operation string is also used in / / add partitions to transaction handler result = new transactional request result ( " add partitions to txn " ) ; result done ( ) ; } return result ; } }


return the events that match the given parameters

public timeline events get events ( @ context http servlet request req , @ context http servlet response res , @ path param ( " entity type " ) string entity type , @ query param ( " entity id " ) string entity id , @ query param ( " event type " ) string event type , @ query param ( " window start " ) string window start , @ query param ( " window end " ) string window end , @ query param ( " limit " ) string limit ) { init ( res ) ; try { return timeline data manager get events ( parse str ( entity type ) , parse array str ( entity id , " , " ) , parse array str ( event type , " , " ) , parse long str ( window start ) , parse long str ( window end ) , parse long str ( limit ) , get user ( req ) ) ; } catch ( number format exception e ) { throw ( bad request exception ) new bad request exception ( " window start , window end or limit is not a numeric value " ) init cause ( e ) ; } catch ( exception e ) { log error ( " error getting entity timelines " , e ) ; throw new web application exception ( e , response status internal server error ) ; } }


public static void update rop statistics ( rop method non opt rmeth , rop method rmeth ) { int old count insns = non opt rmeth get blocks ( ) get effective instruction count ( ) ; int old count regs = non opt rmeth get blocks ( ) get reg count ( ) ; if ( debug ) { system err println ( " insns ( old / new ) : " + old count insns + " / " + rmeth get blocks ( ) get effective instruction count ( ) + " regs ( o / n ) : " + old count regs + " / " + rmeth get blocks ( ) get reg count ( ) ) ; } int new count insns = rmeth get blocks ( ) get effective instruction count ( ) ; running delta insns + = ( new count insns - old count insns ) ; running delta registers + = ( rmeth get blocks ( ) get reg count ( ) - old count regs ) ; running total insns + = new count insns ; }


public static m t application component get instance ( ) { return application manager get application ( ) get component ( m t application component class ) ; }


blocks until { @ link # release blocker ( ) } is called or this thread is interrupted notifies the awaiting thread that waits in the method { @ link # await blocker ( ) }

public void block ( ) throws interrupted exception { synchronized ( lock ) { blocker ready = true ; lock notify all ( ) ; while ( ! blocker released ) { lock wait ( ) ; } } }


returns true if there is at least one tool listening to this tool ' s plugin events

public boolean has tool listeners ( ) { return event mgr has tool listeners ( ) ; }


execute the command specified by { @ link # add arguments ( iterable ) }

starlark execution result execute ( ) throws eval exception , interrupted exception { preconditions check argument ( timeout > 0 , " timeout must be set prior to calling execute ( ) " ) ; preconditions check argument ( ! args is empty ( ) , " no command specified " ) ; preconditions check state ( ! executed , " command was already executed , cannot re - use builder " ) ; preconditions check not null ( directory , " directory must be set before calling execute ( ) " ) ; executed = true ; delegating out err delegator = new delegating out err ( ) ; recording out err recorder = new recording out err ( ) ; / / todo ( dmarting ) : if a lot of data is sent to stdout , this will use all the memory and / / bazel will crash maybe we should use custom output streams that throw an appropriate / / exception when reaching a specific size delegator add sink ( recorder ) ; if ( ! quiet ) { delegator add sink ( out err create ( system err , system err ) ) ; } try { string [ ] args array = new string [ args size ( ) ] ; for ( int i = 0 ; i < args size ( ) ; i + + ) { args array [ i ] = args get ( i ) ; } command command = new command ( args array , env builder , directory , duration of millis ( timeout ) ) ; command result result = command execute ( delegator get output stream ( ) , delegator get error stream ( ) ) ; return new starlark execution result ( result get termination status ( ) get exit code ( ) , recorder out as latin 1 ( ) , recorder err as latin 1 ( ) ) ; } catch ( bad exit status exception e ) { return new starlark execution result ( e get result ( ) get termination status ( ) get exit code ( ) , recorder out as latin 1 ( ) , recorder err as latin 1 ( ) ) ; } catch ( abnormal termination exception e ) { termination status status = e get result ( ) get termination status ( ) ; if ( status timed out ( ) ) { / / signal a timeout by an exit code outside the normal range return new starlark execution result ( 256 , " " , e get message ( ) ) ; } else if ( status exited ( ) ) { return new starlark execution result ( status get exit code ( ) , to string ( e get result ( ) get stdout stream ( ) ) , to string ( e get result ( ) get stderr stream ( ) ) ) ; } else if ( status get terminating signal ( ) = = 15 ) { / / we have a bit of a problem here : we cannot distingusih between the case where / / the sigterm was sent by something that the calling rule wants to legitimately handle , / / and the case where it was sent by bazel to abort the build , e g , because something / / else failed / / / / we just assume the latter to correctly handle aborts , accepting that rule authors have / / to write their rules without relying on the ability to handle termination by signal 15 throw new interrupted exception ( ) ; } else { return new starlark execution result ( status get raw exit code ( ) , to string ( e get result ( ) get stdout stream ( ) ) , to string ( e get result ( ) get stderr stream ( ) ) ) ; } } catch ( command exception e ) { / / 256 is outside of the standard range for exit code on unixes we are not guaranteed that / / on all system it would be outside of the standard range return new starlark execution result ( 256 , " " , e get message ( ) ) ; } }


public byte get count ( ) { return count ; }


test block manager won ' t leave safe mode if datanode threshold is not met

public void test datanode threshod should be met ( ) throws exception { bm safe mode activate ( block total ) ; / / all datanode have not registered yet when ( dn get num live data nodes ( ) ) then return ( 1 ) ; set block safe ( block threshold ) ; bm safe mode check safe mode ( ) ; assert true ( bm safe mode is in safe mode ( ) ) ; / / the datanode number reaches threshold after all data nodes register when ( dn get num live data nodes ( ) ) then return ( datanode num ) ; bm safe mode check safe mode ( ) ; wait for extension period ( ) ; assert false ( bm safe mode is in safe mode ( ) ) ; }


returns the settings mapped to the given setting name

public settings get as settings ( string setting ) { return get by prefix ( setting + " " ) ; }


helper for { @ link # visit constant } where the constant is a { @ code long }

private void visit literal long ( int opcode , int offset , int length , long value ) { string comment or lit = ( length = = 1 ) ? " / / " : " # " ; string value str ; if ( length = = 1 ) { value str = hex s 1 ( ( int ) value ) ; } else { value str = hex s 8 ( value ) ; } observer parsed ( bytes , offset , length , header ( offset ) + comment or lit + value str ) ; }


public void reset ( ) { byte offset = 0 ; bit offset = 0 ; }


sets the minimum decode interval decoding of intermediate results won ' t happen more often that interval ms if another intermediate result comes too soon , it will be decoded only after interval ms since the last decode if there were more intermediate results in between , only the last one gets decoded

public t set min decode interval ms ( int interval ms ) { m min decode interval ms = interval ms ; return get this ( ) ; }


generates a result from the given map of events the events are identified by their names only one resulting element can be generated

out select ( map < string , list < in > > pattern ) throws exception ;


public void handle transport error ( stomp session session , throwable exception ) { }


reads value as diff from stream if this serializer supports diffable values reading operation can be made dependent on map key

diff < v > read diff ( stream input in , k key ) throws i o exception ;


called when ever an s s l engine is not wrapped by a { @ link ssl handler } and inserted into a pipeline

protected void cleanup server ssl engine ( s s l engine engine ) { }


discards { @ code n } characters of data from the reader this method will block until the full amount has been skipped does not close the reader

public static void skip fully ( reader reader , long n ) throws i o exception { check not null ( reader ) ; while ( n > 0 ) { long amt = reader skip ( n ) ; if ( amt = = 0 ) { throw new e o f exception ( ) ; } n - = amt ; } }


writes an info log message containing the parameters


public static string format ( float value , boolean is grouping , int fraction digits ) { return format ( value , is grouping , 1 , fraction digits , true ) ; }


returns the abstract type corresponding to the internal name of a class

static int get abstract type from internal name ( final symbol table symbol table , final string internal name ) { return reference kind | symbol table add type ( internal name ) ; }


reports an exception , see { @ link bug report # send bug report ( throwable ) }

void send bug report ( throwable exception ) ;


augments the given exception with the given context , and return the result the result is either the given exception if it was an { @ link exception with context } , or a newly - constructed exception if it was not

public static exception with context with context ( throwable ex , string str ) { exception with context ewc ; if ( ex instanceof exception with context ) { ewc = ( exception with context ) ex ; } else { ewc = new exception with context ( ex ) ; } ewc add context ( str ) ; return ewc ; }


public rpc service get rpc service ( ) { return rpc service ; }


creates a user with the specified name and options

public v user info create user ( string name , int flags ) { try { return m service create user ( name , flags ) ; } catch ( remote exception re ) { log w ( tag , " could not create a user " , re ) ; return null ; } }


returns the specific integer value , if applicable


set the given , single header value under the given name

public void set ( string header name , @ nullable string header value ) { this headers set ( header name , header value ) ; }


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


re - initialize the { @ link reservation system }

void reinitialize ( configuration conf , r m context rm context ) throws yarn exception ;


tries to assign the given slot to the execution the assignment works only if the execution is in state scheduled returns true , if the resource could be assigned

public boolean try assign resource ( final logical slot logical slot ) { assert running in job master main thread ( ) ; check not null ( logical slot ) ; / / only allow to set the assigned resource in state scheduled or created / / note : we also accept resource assignment when being in state created for testing purposes if ( state = = scheduled | | state = = created ) { if ( assigned resource = = null ) { assigned resource = logical slot ; if ( logical slot try assign payload ( this ) ) { / / check for concurrent modification ( e g cancelling call ) if ( ( state = = scheduled | | state = = created ) & & ! task manager location future is done ( ) ) { task manager location future complete ( logical slot get task manager location ( ) ) ; assigned allocation i d = logical slot get allocation id ( ) ; return true ; } else { / / free assigned resource and return false assigned resource = null ; return false ; } } else { assigned resource = null ; return false ; } } else { / / the slot already has another slot assigned return false ; } } else { / / do not allow resource assignment if we are not in state scheduled return false ; } }


get decoding hints based on the server request or annotations on the target controller method parameter

default map < string , object > get encode hints ( resolvable type actual type , resolvable type element type , @ nullable media type media type , server http request request , server http response response ) { return hints none ( ) ; }


if a schema contains a reference to another schema with ' $ ref ' , returns the referenced schema if it is found or the actual schema in the other cases

public static schema get referenced schema ( open a p i open a p i , schema schema ) { if ( schema ! = null & & string utils is not empty ( schema get $ ref ( ) ) ) { string name = get simple ref ( schema get $ ref ( ) ) ; schema referenced schema = get schema ( open a p i , name ) ; if ( referenced schema ! = null ) { return referenced schema ; } } return schema ; }


atomically sets the subscription on the field if it is still null if the field is not null and doesn ' t contain the { @ link # cancelled } instance , the { @ link # report subscription set ( ) } is called

public static boolean set once ( atomic reference < subscription > field , subscription s ) { objects require non null ( s , " s is null " ) ; if ( ! field compare and set ( null , s ) ) { s cancel ( ) ; if ( field get ( ) ! = cancelled ) { report subscription set ( ) ; } return false ; } return true ; }


convert a url query namevalue parameter to a list of encoded { @ link pair } objects the value can be null , in which case an empty list is returned

public static list < pair > parameter to pairs ( string name , object value ) { if ( name = = null | | name is empty ( ) | | value = = null ) { return collections empty list ( ) ; } return collections singleton list ( new pair ( url encode ( name ) , url encode ( value to string ( ) ) ) ) ; }


returns whether this worker is configured to allow source connectors to create the topics that they use with custom configurations , if these topics don ' t already exist

public boolean is topic creation enabled ( ) { return config topic creation enable ( ) ; }


returns the string of the utf 8 constant at the specified index in the reusable constant pool

private string get string ( int constant index ) { return ( ( utf 8 constant ) constant pool [ constant index ] ) get string ( ) ; }


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 item type item type ( ) { return item type ; }


to be invoked only by the jackson json serializer

public hash map < string , state pair > get states ( ) { return pool ; }


convenience method for constructing composite formats given operation ( op ) , object class ( inf ) , set of paths ( p ) return : { @ code ( tbl ( < inf > , < p 1 > ) , tbl ( < inf > , < p 2 > ) , , tbl ( < inf > , < pn > ) ) }

public static string compose ( string op , class < ? extends input format > inf , string path ) { final string infname = inf get name ( ) ; string buffer ret = new string buffer ( op + ' ( ' ) ; for ( string p : path ) { compose ( infname , p , ret ) ; ret append ( ' , ' ) ; } ret set char at ( ret length ( ) - 1 , ' ) ' ) ; return ret to string ( ) ; }


returns < code > null < code > if the datafeed is not running on this node

private string get job id if datafeed running on this node ( transport start datafeed action datafeed task task ) { holder holder = running datafeeds on this node get ( task get allocation id ( ) ) ; if ( holder = = null ) { return null ; } return holder get job id ( ) ; }


save the symbol description as a tag to the xml stream this does not save the mappings

public void save x m l ( string builder buf ) { buf append ( " < symbol " ) ; save x m l header ( buf ) ; buf append ( " > \ n " ) ; buf append ( dtmanage build type ref ( type , get size ( ) ) ) ; buf append ( " < / symbol > \ n " ) ; }


scan { @ code uri } for a session id this is identified by scanning for " { code session } " and then extracting the next fragment of the url this means that both " { @ code sessionfoo } " and " { @ code wdhubsessionfoobar } " would both identify the session id as being " foo "

public static optional < string > get session id ( string uri ) { int session index = uri index of ( " / session / " ) ; if ( session index ! = - 1 ) { session index + = " / session / " length ( ) ; int next slash = uri index of ( " / " , session index ) ; if ( next slash ! = - 1 ) { return optional of ( uri substring ( session index , next slash ) ) ; } return optional of ( uri substring ( session index ) ) ; } return optional empty ( ) ; }


creates a { @ code copy on write array set } instance containing the given elements

public static < e > copy on write array set < e > new copy on write array set ( iterable < ? extends e > elements ) { / / we copy elements to an array list first , rather than incurring the / / quadratic cost of adding them to the cowas directly collection < ? extends e > elements collection = ( elements instanceof collection ) ? ( collection < ? extends e > ) elements : lists new array list ( elements ) ; return new copy on write array set < e > ( elements collection ) ; }


public void close ( ) { if ( replica ! = null ) { if ( anchored ) { replica remove no checksum anchor ( ) ; } replica unref ( ) ; } replica = null ; }


ask the extension whether it vetoes killing of the given process

public abstract veto cause veto process killing ( @ non null i o s process p ) ;


adds a constant value by reference any value encountered during serialization which { @ code = = object } will be replaced by { @ code object } upon deserialization interned objects and effective singletons are ideal for reference constants these constants should be interned or effectively interned : it should not be possible to create objects that should be considered equal in which one has an element of this list and the other does not , since that would break bit - for - bit equality of the objects ' serialized bytes when used in { @ link com google devtools build skyframe sky key } s note that even { @ link boolean } does not satisfy this constraint , since { @ code new boolean ( true ) } is allowed , but upon deserialization , when a { @ code boolean } is boxed to a { @ link boolean } , it will always be { @ link boolean # true } or { @ link boolean # false } the same is not true for an empty { @ link immutable list } , since an empty non - { @ link immutable list } will not serialize to an { @ link immutable list } , and so won ' t be deserialized to an empty { @ link immutable list } if an object has a list field , and one codepath passes in an empty { @ link array list } and another passes in an empty { @ link immutable list } , and two objects constructed in this way can be considered equal , then those two objects already do not serialize bit - for - bit identical disregarding this list of constants , since the list object ' s codec will be different for the two objects

public builder add reference constant ( object object ) { reference constants builder add ( object ) ; return this ; }


triggers { @ link # refresh ( ) } if not refreshed in the concrete context ' s constructor already

public void after properties set ( ) { if ( ! is active ( ) ) { refresh ( ) ; } }


create a new instance by aborting this instance moving all in - progress shards to { @ link shard state # aborted } if assigned to a data node or to { @ link shard state # failed } if not assigned to any data node if the instance had no in - progress shard snapshots assigned to data nodes it ' s moved to state { @ link state # success } , otherwise it ' s moved to state { @ link state # aborted } in the special case where this instance has not yet made any progress on any shard this method just returns { @ code null } since no abort is needed and the snapshot can simply be removed from the cluster state outright

public entry abort ( ) { final immutable open map builder < shard id , shard snapshot status > shards builder = immutable open map builder ( ) ; boolean completed = true ; boolean all queued = true ; for ( object object cursor < shard id , shard snapshot status > shard entry : shards ) { shard snapshot status status = shard entry value ; all queued & = status state ( ) = = shard state queued ; if ( status state ( ) completed ( ) = = false ) { final string node id = status node id ( ) ; status = new shard snapshot status ( node id , node id = = null ? shard state failed : shard state aborted , " aborted by snapshot deletion " , status generation ( ) ) ; } completed & = status state ( ) completed ( ) ; shards builder put ( shard entry key , status ) ; } if ( all queued ) { return null ; } return fail ( shards builder build ( ) , completed ? state success : state aborted , aborted failure text ) ; }


returns a new method spec builder that overrides { @ code method } this will copy its visibility modifiers , type parameters , return type , name , parameters , and throws declarations an { @ link override } annotation will be added note that in java poet 1 2 through 1 7 this method retained annotations from the method and parameters of the overridden method since java poet 1 8 annotations must be added separately

public static builder overriding ( executable element method ) { check not null ( method , " method = = null " ) ; element enclosing class = method get enclosing element ( ) ; if ( enclosing class get modifiers ( ) contains ( modifier final ) ) { throw new illegal argument exception ( " cannot override method on final class " + enclosing class ) ; } set < modifier > modifiers = method get modifiers ( ) ; if ( modifiers contains ( modifier private ) | | modifiers contains ( modifier final ) | | modifiers contains ( modifier static ) ) { throw new illegal argument exception ( " cannot override method with modifiers : " + modifiers ) ; } string method name = method get simple name ( ) to string ( ) ; method spec builder method builder = method spec method builder ( method name ) ; method builder add annotation ( override class ) ; modifiers = new linked hash set < > ( modifiers ) ; modifiers remove ( modifier abstract ) ; modifiers remove ( modifier default ) ; method builder add modifiers ( modifiers ) ; for ( type parameter element type parameter element : method get type parameters ( ) ) { type variable var = ( type variable ) type parameter element as type ( ) ; method builder add type variable ( type variable name get ( var ) ) ; } method builder returns ( type name get ( method get return type ( ) ) ) ; method builder add parameters ( parameter spec parameters of ( method ) ) ; method builder varargs ( method is var args ( ) ) ; for ( type mirror thrown type : method get thrown types ( ) ) { method builder add exception ( type name get ( thrown type ) ) ; } return method builder ; }


gets the writer to use to write to the left column

public writer get left ( ) { return left column ; }


public static < t > t register bean into application context ( final configurable application context application context , final class < t > bean clazz , final string bean id ) { val bean factory = application context get bean factory ( ) ; val provider = bean factory create bean ( bean clazz ) ; bean factory initialize bean ( provider , bean id ) ; bean factory autowire bean ( provider ) ; bean factory register singleton ( bean id , provider ) ; return provider ; }


public void add mapping ( int old reg , int new reg , int category ) { super add mapping ( old reg , new reg , category ) ; add interfence ( new reg , old reg ) ; if ( category = = 2 ) { add interfence ( new reg + 1 , old reg ) ; } }


returns the upper endpoint of this range

public c upper endpoint ( ) { return upper bound endpoint ( ) ; }


void on search complete ( search result result ) ;


enabledisable debugging for this api client

public api client set debugging ( boolean debugging ) { if ( debugging ! = this debugging ) { if ( debugging ) { logging interceptor = new http logging interceptor ( ) ; logging interceptor set level ( level body ) ; http client = http client new builder ( ) add interceptor ( logging interceptor ) build ( ) ; } else { final ok http client builder builder = http client new builder ( ) ; builder interceptors ( ) remove ( logging interceptor ) ; http client = builder build ( ) ; logging interceptor = null ; } } this debugging = debugging ; return this ; }


public void update persistent task state ( final string task id , final long task allocation id , final persistent task state task state , final action listener < persistent task < ? > > listener ) { cluster service submit state update task ( " update task state [ " + task id + " ] " , new cluster state update task ( ) { @ override public cluster state execute ( cluster state current state ) { persistent tasks custom metadata builder tasks in progress = builder ( current state ) ; if ( tasks in progress has task ( task id , task allocation id ) ) { return update ( current state , tasks in progress update task state ( task id , task state ) ) ; } else { if ( tasks in progress has task ( task id ) ) { logger warn ( " trying to update state on task { } with unexpected allocation id { } " , task id , task allocation id ) ; } else { logger warn ( " trying to update state on non - existing task { } " , task id ) ; } throw new resource not found exception ( " the task with id { } and allocation id { } doesn ' t exist " , task id , task allocation id ) ; } } @ override public void on failure ( string source , exception e ) { listener on failure ( e ) ; } @ override public void cluster state processed ( string source , cluster state old state , cluster state new state ) { listener on response ( persistent tasks custom metadata get task with id ( new state , task id ) ) ; } } ) ; }


ignore an optional leading ` ` in the domain

@ test public void domain matches ignores leading dot ( ) throws exception { cookie cookie = cookie parse ( url , " a = b ; domain = example com " ) ; assert that ( cookie matches ( http url get ( " http : / / example com " ) ) ) is true ( ) ; assert that ( cookie matches ( http url get ( " http : / / www example com " ) ) ) is true ( ) ; assert that ( cookie matches ( http url get ( " http : / / square com " ) ) ) is false ( ) ; }


test a dn waits for the volume scanners to finish before shutting down

public void test slow datanode shutdown ( ) throws exception { / / set the join time out to a value larger than the completion time of the / / volume scanner test datanode shut down ( time unit minutes to millis ( 5 ) , 1000l , false ) ; }


extracts the specified field out of data map , or alternative falls back to the action value

private string get field ( string action id , string watch id , string name , map < string , object > data , string field name , string default value ) { object obj = data remove ( field name ) ; if ( obj ! = null ) { if ( default value ! = null ) { throw illegal state ( " could not execute action [ { } ] of watch [ { } ] " + " [ ctx payload { } ] or [ ctx payload doc { } ] were set together with action [ { } ] field only set one of them " , action id , watch id , field name , field name , name ) ; } else { return obj to string ( ) ; } } return default value ; }


forces a refilter , even though filtering operations may be disabled

public void force refilter ( ) { one to many table model re filter ( ) ; }


returns the offset component of the msft symbol hash record

public long get offset ( ) { return offset val ; }


get the root directory of trash for current user when the path specified is deleted

public path get trash root ( path path ) { return this make qualified ( new path ( get home directory ( ) to uri ( ) get path ( ) , trash prefix ) ) ; }


receive a message from this channel , blocking indefinitely if necessary


called when the player starts or stops loading the source

default void on is loading changed ( boolean is loading ) { on loading changed ( is loading ) ; }


returns a random version index compatible with the given version , but not the given version

public static version random previous compatible version ( random random , version version ) { / / todo : change this to minimum compatibility version ( ) , but first need to remove released / unreleased / / versions so get previous verison returns the * actual * previous version otherwise eg 8 0 0 returns say 7 0 2 for previous , / / but 7 2 0 for minimum compat return random version between ( random , version minimum index compatibility version ( ) , get previous version ( version ) ) ; }


a convenient way to produce a new record if you only need to change the headers copies the attributes of this record with the headers replaced also makes a copy of the provided headers see { @ link processor context # forward ( record ) } for considerations around mutability of keys , values , and headers

public record < k , v > with headers ( final headers headers ) { return new record < > ( key , value , timestamp , headers ) ; }


returns true if this cached response should be used ; false if the network response should be used

public boolean validate ( response headers network response ) { if ( network response headers get response code ( ) = = http u r l connection http not modified ) { return true ; } / * * the http spec says that if the network ' s response is older than our * cached response , we may return the cache ' s response like chrome ( but * unlike firefox ) , this client prefers to return the newer response * / if ( last modified ! = null & & network response last modified ! = null & & network response last modified get time ( ) < last modified get time ( ) ) { return true ; } return false ; }


returns the selected file this can be set either by the programmer via { @ link # set selected file ( file ) } or by a user action , such as either typing the filename into the ui or selecting the file from a list in the ui note : this method can be called after the chooser has been shown , in which case the value returned has been validated by the chooser also , the method may be called while the chooser is showing ( like from a test thread ) in this case , the selected file will not have been validated by the chooser

public file get selected file ( boolean show ) { if ( show ) { return get selected file ( ) ; } if ( is showing ( ) ) { / / note : this is an unvalidated file , as this method has been called while / / the file chooser is still showing , before any validation has taken place return selected files get file ( ) ; } return validated files get file ( ) ; }


returns the members injector used to inject dependencies into methods and fields on instances of the given type { @ code t } the returned members injector will not be valid until the main { @ link injector } has been created the members injector will throw an { @ code illegal state exception } if you try to use it beforehand

< t > members injector < t > get members injector ( type literal < t > type literal ) ;


convert the entity from a { @ link response } into a map of maps

public static map < string , object > entity as map ( response response ) throws i o exception { x content type x content type = x content type from media type ( response get entity ( ) get content type ( ) get value ( ) ) ; / / empty and throw are fine here because ` map ` doesn ' t use named x content or deprecation try ( x content parser parser = x content type x content ( ) create parser ( named x content registry empty , deprecation handler throw unsupported operation , response get entity ( ) get content ( ) ) ) { return parser map ( ) ; } }


this makes sure that when dn closes clients socket after client had successfully connected earlier , the data can still be fetched

public void test write timeout at data node ( ) throws i o exception , interrupted exception { final int write timeout = 100 ; / / milliseconds / / set a very short write timeout for datanode , so that tests runs fast conf set int ( hdfs client config keys dfs datanode socket write timeout key , write timeout ) ; / / set a smaller block size final int block size = 10 * 1024 * 1024 ; conf set int ( d f s config keys dfs block size key , block size ) ; conf set int ( hdfs client config keys dfs client max block acquire failures key , 1 ) ; / / set a small buffer size final int buffer size = 4096 ; conf set int ( common configuration keys io file buffer size key , buffer size ) ; mini d f s cluster cluster = new mini d f s cluster builder ( conf ) num data nodes ( 3 ) build ( ) ; try { cluster wait active ( ) ; file system fs = cluster get file system ( ) ; path file path = new path ( " / test write timeout at data node " ) ; output stream out = fs create ( file path , true , buffer size ) ; / / write a 2 block file write data ( out , 2 * block size ) ; out close ( ) ; byte [ ] buf = new byte [ 1024 * 1024 ] ; / / enough to empty tcp buffers input stream in = fs open ( file path , buffer size ) ; / / first read a few bytes i o utils read fully ( in , buf , 0 , buffer size / 2 ) ; / / now read few more chunks of data by sleeping in between : for ( int i = 0 ; i < 10 ; i + + ) { thread sleep ( 2 * write timeout ) ; / / force write timeout at the datanode / / read enough to empty out socket buffers i o utils read fully ( in , buf , 0 , buf length ) ; } / / successfully read with write timeout on datanodes in close ( ) ; } finally { cluster shutdown ( ) ; } } / / more tests related to different failure cases can be added here


whether this partition is released a partition is released when each subpartition is either consumed and communication is closed by consumer or failed a partition is also released if task is cancelled

public boolean is released ( ) { return is released get ( ) ; }


return the string expression for this pointcut


private void set glob paths ( string pattern , boolean exclude directories , future < list < path > > result ) { glob cache put ( pair of ( pattern , exclude directories ) , result ) ; }


tests that if an idempotent operation succeeds second time after socket timeout exception , then the operation is successful

public void test client retries idempotent op with socket timeout exception succeeds ( ) throws exception { configuration conf = new configuration ( ) ; conf set int ( common configuration keys public kms client failover max retries key , 3 ) ; final list < string > keys = arrays as list ( " test key " ) ; k m s client provider p 1 = mock ( k m s client provider class ) ; when ( p 1 get keys ( ) ) then throw ( new socket timeout exception ( " p 1 " ) ) then return ( keys ) ; k m s client provider p 2 = mock ( k m s client provider class ) ; when ( p 2 get keys ( ) ) then throw ( new socket timeout exception ( " p 2 " ) ) ; when ( p 1 get k m s url ( ) ) then return ( " p 1 " ) ; when ( p 2 get k m s url ( ) ) then return ( " p 2 " ) ; load balancing k m s client provider kp = new load balancing k m s client provider ( new k m s client provider [ ] { p 1 , p 2 } , 0 , conf ) ; list < string > result = kp get keys ( ) ; assert equals ( keys , result ) ; verify ( p 1 , mockito times ( 2 ) ) get keys ( ) ; verify ( p 2 , mockito times ( 1 ) ) get keys ( ) ; }


returns a { @ link package identifier } identifying the most specific containing directory of the patterns that could be matched by this pattern note that we are using the { @ link package identifier } type as a convenience ; there may not actually be a package corresponding to this directory ! this returns a { @ link package identifier } that identifies the referred - to directory for example , for " foobar " , this method returns a { @ link package identifier } for " foobar "

public package identifier get directory ( ) { return directory ; }


adds mapping that will be added when the index gets created

public put index template request mapping ( string source , x content type x content type ) { return mapping ( new bytes array ( source ) , x content type ) ; }


public reader get n character stream ( string column label ) throws s q l exception { return null ; }


return array of icons that were added to this mult icon

public icon [ ] get icons ( ) { return icon list to array ( new icon [ icon list size ( ) ] ) ; }


public j s o n writer value ( long l ) throws j s o n exception { return this append ( long to string ( l ) ) ; }


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 ( ) { string order id = null ; / / api delete order ( order id ) ; / / todo : test validations }


creates an { @ link execution config accessor } based on the provided { @ link configuration }

public static execution config accessor from configuration ( final configuration configuration ) { return new execution config accessor ( check not null ( configuration ) ) ; }


quota callback invoked to determine the quota metric tags to be applied for a request quota limits are associated with quota metrics and all clients which use the same metric tags share the quota limit

map < string , string > quota metric tags ( client quota type quota type , kafka principal principal , string client id ) ;


return the { @ link method } mapped to the given exception type , or { @ link # no matching exception handler method } if none

private method get mapped method ( class < ? extends throwable > exception type ) { list < class < ? extends throwable > > matches = new array list < > ( ) ; for ( class < ? extends throwable > mapped exception : this mapped methods key set ( ) ) { if ( mapped exception is assignable from ( exception type ) ) { matches add ( mapped exception ) ; } } if ( ! matches is empty ( ) ) { if ( matches size ( ) > 1 ) { matches sort ( new exception depth comparator ( exception type ) ) ; } return this mapped methods get ( matches get ( 0 ) ) ; } else { return no matching exception handler method ; } }


test { @ link java j a x r s spec server codegen # add operation to group ( string , string , operation , codegen operation , map ) } for resource with path " subresource "

public void test add operation to group for subresource ( ) { codegen operation codegen operation = new codegen operation ( ) ; codegen operation path = " / subresource " ; operation operation = new operation ( ) ; map < string , list < codegen operation > > operation list = new hash map < > ( ) ; codegen add operation to group ( " default " , " / subresource " , operation , codegen operation , operation list ) ; assert assert equals ( codegen operation base name , " subresource " ) ; assert assert equals ( operation list size ( ) , 1 ) ; assert true ( operation list contains key ( " subresource " ) ) ; }


the boost of the query it should typically be incorporated into the score as a multiplicative factor

public float get boost ( ) { return boost ; }


creates a new image that is the same as the given image but has the given colored pixels replaced with the given new color

public static image change color ( image image , color old color , color new color ) { objects require non null ( image ) ; buffered image src image = new buffered image ( image get width ( null ) , image get height ( null ) , buffered image type int argb ) ; graphics graphics = src image get graphics ( ) ; graphics draw image ( image , 0 , 0 , null ) ; graphics dispose ( ) ; int [ ] old rgb = new int [ ] { old color get red ( ) , old color get green ( ) , old color get blue ( ) } ; int [ ] new rgb = new int [ ] { new color get red ( ) , new color get green ( ) , new color get blue ( ) } ; buffered image dest image = new buffered image ( image get width ( null ) , image get height ( null ) , buffered image type int argb ) ; lookup table table = new lookup table ( 0 , 4 ) { @ override / / overridden to pass in the complete pixel data public int [ ] lookup pixel ( int [ ] src , int [ ] dest ) { return filter rgb change color ( src , dest , old rgb , new rgb ) ; } } ; lookup op lookup op = new lookup op ( table , null ) ; lookup op filter ( src image , dest image ) ; return dest image ; }


gets the b register number , as a code unit this will throw if the value is out of the range of an unsigned code unit

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


extract the method name out of a fully qualified method name may return { @ code null } if the input is malformed , but you cannot rely on it for the validity of the input

public static string extract bare method name ( string full method name ) { int index = check not null ( full method name , " full method name " ) last index of ( ' / ' ) ; if ( index = = - 1 ) { return null ; } return full method name substring ( index + 1 ) ; }


called when the { @ link chunk sample stream } has finished being released

void on sample stream released ( chunk sample stream < t > chunk sample stream ) ;


log a message at the warn level according to the specified format and argument this form avoids superfluous object creation when the logger is disabled for the warn level

public void warn ( string format , object arg ) { if ( logger is enabled for ( level warn ) ) { formatting tuple ft = message formatter format ( format , arg ) ; logger log ( fqcn , level warn , ft get message ( ) , ft get throwable ( ) ) ; } }


parse the path component from the given request and return wo decoding

public static string get raw path ( final http servlet request request , string servlet name ) { preconditions check argument ( request get request u r i ( ) starts with ( servlet name + " / " ) ) ; return request get request u r i ( ) substring ( servlet name length ( ) ) ; }


called when the renderer ' s offset has been changed the default implementation is a no - op

protected void on renderer offset changed ( long offset us ) throws exo playback exception { / / do nothing }


get all properties belonging to list of input tags calls get all properties by tag internally

public properties get all properties by tags ( final list < string > tag list ) { properties prop = new properties ( ) ; for ( string tag : tag list ) { prop put all ( this get all properties by tag ( tag ) ) ; } return prop ; }


should the node indices stats be returned

public nodes stats request builder set indices ( boolean indices ) { request indices ( indices ) ; return this ; }


find the bean name for the current invocation assumes that an expose bean name advisor has been included in the interceptor chain , and that the invocation is exposed with expose invocation interceptor

public static string get bean name ( ) throws illegal state exception { return get bean name ( expose invocation interceptor current invocation ( ) ) ; }


tests that the max parallelism is properly set for connected streams

public void test max parallelism with connected keyed stream ( ) { int max parallelism = 42 ; stream execution environment env = stream execution environment get execution environment ( ) ; data stream < integer > input 1 = env from elements ( 1 , 2 , 3 , 4 ) set max parallelism ( 128 ) ; data stream < integer > input 2 = env from elements ( 1 , 2 , 3 , 4 ) set max parallelism ( 129 ) ; env get config ( ) set max parallelism ( max parallelism ) ; data stream < integer > keyed result = input 1 connect ( input 2 ) key by ( value - > value , value - > value ) map ( new no op int co map ( ) ) ; keyed result add sink ( new discarding sink < > ( ) ) ; stream graph graph = env get stream graph ( ) ; stream node keyed result node = graph get stream node ( keyed result get id ( ) ) ; stream partitioner < ? > stream partitioner 1 = keyed result node get in edges ( ) get ( 0 ) get partitioner ( ) ; stream partitioner < ? > stream partitioner 2 = keyed result node get in edges ( ) get ( 1 ) get partitioner ( ) ; }


get the string representation of the local name

default string get local name ( ) { return d f s util client bytes 2 string ( get local name in bytes ( ) ) ; }


public long get end pointer ( ) { return internals get end pointer ( ) ; }


not supported < b > you are attempting to create a map that may contain non - { @ code comparable } keys < b > proper calls will resolve to the version in { @ code immutable sorted map } , not this dummy version

public static < k , v > immutable sorted map < k , v > of ( k k 1 , v v 1 , k k 2 , v v 2 , k k 3 , v v 3 , k k 4 , v v 4 ) { throw new unsupported operation exception ( ) ; }


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


public int size ( ) { return rows size ( ) - ( has header ? 1 : 0 ) ; }


this a sanity check to make sure that any filesystem ' s handling of renames non - empty dirs doesn ' t cause any regressions

public void test rename to dir with same prefix allowed ( ) throws throwable { assume true ( rename supported ( ) ) ; final path parentdir = path ( " test rename to dir with same prefix allowed " ) ; fs mkdirs ( parentdir ) ; / / before renaming , we create one file under the source parent directory create file ( new path ( parentdir , " mychild " ) ) ; final path dest = path ( " test rename to dir with same prefix allowed dest " ) ; rename ( parentdir , dest , true , false , true ) ; }


void move to trash ( ) throws i o exception { path src = context get src ( ) ; if ( src fs exists ( src ) ) { trash option trash option = context get trash opt ( ) ; switch ( trash option ) { case trash : conf set float ( fs trash interval key , 60 ) ; if ( ! trash move to appropriate trash ( src fs , src , conf ) ) { throw new i o exception ( " failed move " + src + " to trash " ) ; } break ; case delete : if ( ! src fs delete ( src , true ) ) { throw new i o exception ( " failed delete " + src ) ; } log info ( " { } is deleted " , src ) ; break ; case skip : break ; default : throw new i o exception ( " unexpected trash option = " + trash option ) ; } } }


returns the number of streams found in this { @ link abstract msf }

public int get num streams ( ) { return stream table get num streams ( ) ; }


generates a string form of a request to be written to the logs , filtering the user environment to remove anything that looks private the current filter criteria removes any variable whose name includes " auth " , " pass " , or " cookie "

public static string get request log string ( list < string > request strings ) { string builder buf = new string builder ( ) ; buf append ( ' [ ' ) ; string sep = " " ; matcher m = suppress from log matcher ( " " ) ; for ( string s : request strings ) { buf append ( sep ) ; m reset ( s ) ; if ( m looking at ( ) ) { buf append ( m group ( ) ) ; buf append ( " private value removed " ) ; } else { buf append ( s ) ; } sep = " , " ; } buf append ( ' ] ' ) ; return buf to string ( ) ; }


update the addresses in all records to reflect the movement of a memory block

abstract void move address range ( address from addr , address to addr , long length , task monitor monitor ) throws cancelled exception , i o exception ;


create a { @ link namespaces } containing the singular namespace used by the name , or an empty one

public static namespaces from ( q name name ) { if ( name get prefix ( ) is empty ( ) ) { return empty ( ) ; } return new namespaces ( immutable sorted map of ( name get prefix ( ) , name get namespace u r i ( ) ) ) ; }


emits { @ link string } output of this class into the provided { @ link string builder }

public void emit ( string builder builder ) { builder append ( this get class ( ) get simple name ( ) ) ; }


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


returns the set of defines needed to compile this target this includes definitions from the transitive deps closure for the target the order of the returned collection is deterministic

public immutable list < string > get defines ( ) { return command line cc compilation context defines ; }


public string get ssl proxy ( ) { return ssl proxy ; }


return the value of the { @ code pragma } header

public string get pragma ( ) { return get first ( pragma ) ; }


verifies that the given scheduler does not deliver handled errors to its executing thread ' s { @ link java lang thread uncaught exception handler }

static void handled error is not delivered to thread handler ( scheduler scheduler ) throws interrupted exception { thread uncaught exception handler original handler = thread get default uncaught exception handler ( ) ; try { capturing uncaught exception handler handler = new capturing uncaught exception handler ( ) ; capturing observer < object > observer = new capturing observer < > ( ) ; thread set default uncaught exception handler ( handler ) ; illegal state exception error = new illegal state exception ( " should be delivered to handler " ) ; flowable error ( error ) subscribe on ( scheduler ) subscribe ( observer ) ; if ( ! observer completed await ( 3 , time unit seconds ) ) { fail ( " timed out " ) ; } if ( handler count ! = 0 ) { handler caught print stack trace ( ) ; } assert equals ( " handler should not have received anything : " + handler caught , 0 , handler count ) ; assert equals ( " observer should have received an error " , 1 , observer error count ) ; assert equals ( " observer should not have received a next value " , 0 , observer next count ) ; throwable cause = observer error ; while ( cause ! = null ) { if ( error equals ( cause ) ) { break ; } if ( cause = = cause get cause ( ) ) { break ; } cause = cause get cause ( ) ; } assert equals ( " our error should have been delivered to the observer " , error , cause ) ; } finally { thread set default uncaught exception handler ( original handler ) ; } }


protected event do execute ( final request context context ) { try { val request = web utils get http servlet request from external webflow context ( context ) ; val wa = request get parameter ( wa ) ; if ( string utils is not blank ( wa ) & & wa equals ignore case ( wsignin ) ) { ws federation response validator validate ws federation authentication request ( context ) ; return super do execute ( context ) ; } return ws federation request builder build authentication request event ( context ) ; } catch ( final exception ex ) { logging utils error ( logger , ex ) ; throw new unauthorized service exception ( unauthorized service exception code unauthz service , ex get message ( ) ) ; } }


location to write model files you can use the model package ( ) as defined when the class is instantiated

public string model file folder ( ) { return ( output folder + " / model " ) replace ( " / " , file separator ) ; }


destroy the data this operation allows the data structure to release any internal resources before gc


public void write to ( dex file file , annotated output out ) { cst type type = get defining class ( ) ; cst string descriptor = type get descriptor ( ) ; int idx = file get string ids ( ) index of ( descriptor ) ; if ( out annotates ( ) ) { out annotate ( 0 , index string ( ) + ' ' + descriptor to human ( ) ) ; out annotate ( 4 , " descriptor idx : " + hex u 4 ( idx ) ) ; } out write int ( idx ) ; }


prevent any side - effects due to this test modifying thread locals that might affect subsequent tests when all tests are run in the same jvm , as with eclipse

public void tear down ( ) { assert that ( transaction synchronization manager get resource map ( ) is empty ( ) ) is true ( ) ; assert that ( transaction synchronization manager is synchronization active ( ) ) is false ( ) ; assert that ( transaction synchronization manager get current transaction name ( ) ) is null ( ) ; assert that ( transaction synchronization manager is current transaction read only ( ) ) is false ( ) ; assert that ( transaction synchronization manager is actual transaction active ( ) ) is false ( ) ; }


zipkin trace finished by the expired rule

public void on removal ( @ nullable string key , @ nullable zipkin trace trace , @ nonnull removal cause cause ) { if ( trace instanceof zipkin trace trigger trace ) { return ; } try { zipkin 2 sky walking transfer instance transfer ( trace ) ; } catch ( exception e ) { logger error ( e get message ( ) , e ) ; logger warn ( " zipkin trace : " + trace ) ; } }


returns type information for a table api string or sql varchar type

public static type information < string > string ( ) { return org apache flink api common typeinfo types string ; }


sets the token , which together with the scheme , will be sent as the value of the authorization header

public void set bearer token ( string bearer token ) { this bearer token = bearer token ; }


assert that a collection contains elements ; that is , it must not be { @ code null } and must contain at least one element

public static void not empty ( @ nullable collection < ? > collection ) { not empty ( collection , " [ assertion failed ] - this collection must not be empty : it must contain at least 1 element " ) ; }


gets type literal for the given { @ code type } instance

public static type literal < ? > get ( type type ) { return new type literal < object > ( type ) ; }


sets the hovering variables ( hover item , hovering column ) as well as hover detail by talking to the cell renderers triggers a redraw if necessary

private boolean handle cell hover ( int x , int y ) { point point = new point ( x , y ) ; final grid column col = get column ( point ) ; final int row = get row ( point ) ; integer detail = ( hovering on column sorter ? 1000000 : 0 ) + ( hovering on column filter ? 1000000 : 0 ) + y ; boolean hover change = false ; if ( hovering item ! = row | | ! common utils equal objects ( hovering detail , detail ) | | hovering column ! = col | | y < = header height ) { hovering item = row ; hovering detail = detail ; hovering column = col ; hover change = true ; } / / check for link boolean over link = false ; if ( col ! = null & & row > = 0 ) { if ( cell renderer is over link ( col , row , x , y ) ) { over link = true ; } } if ( over link ) { if ( ! hovering on link ) { set cursor ( sort cursor ) ; } } else if ( hovering on link ) { set cursor ( null ) ; } hovering on link = over link ; / / do normal cell specific tooltip stuff if ( hover change ) { / / check tooltip string new tip = null ; if ( ( hovering item > = 0 ) & & ( hovering column ! = null ) ) { if ( over link ) { new tip = get content provider ( ) get cell link text ( column elements [ col get index ( ) ] , row elements [ row ] ) ; } if ( common utils is empty ( new tip ) ) { / / get cell specific tooltip new tip = get cell tool tip ( hovering column , hovering item ) ; } } else if ( column headers visible & & hovering column ! = null & & y < = header height ) { / / get column header specific tooltip if ( hovering on column sorter ) { new tip = nls bind ( data editors messages grid tooltip sort by column , get label provider ( ) get text ( hovering column get element ( ) ) ) ; } else if ( hovering on column filter ) { new tip = nls bind ( data editors messages grid tooltip filter by column , get label provider ( ) get text ( hovering column get element ( ) ) ) ; } else { new tip = hovering column get header tooltip ( ) ; } } else if ( row header visible & & hovering item > = 0 & & x < = row header width ) { new tip = get label provider ( ) get tool tip text ( get row element ( hovering item ) ) ; } / / avoid unnecessarily resetting tooltip - this will cause the tooltip to jump around if ( new tip ! = null & & ! new tip equals ( displayed tool tip text ) ) { tool tip handler update tool tip text ( new tip ) ; } else if ( new tip = = null & & displayed tool tip text ! = null ) { tool tip handler update tool tip text ( null ) ; } displayed tool tip text = new tip ; } return hover change ; }


this implementation returns a description that includes the class path location

public string get description ( ) { string builder builder = new string builder ( " class path resource [ " ) ; string path to use = path ; if ( this clazz ! = null & & ! path to use starts with ( " / " ) ) { builder append ( class utils class package as resource path ( this clazz ) ) ; builder append ( ' / ' ) ; } if ( path to use starts with ( " / " ) ) { path to use = path to use substring ( 1 ) ; } builder append ( path to use ) ; builder append ( ' ] ' ) ; return builder to string ( ) ; }


begins execution of the specified step within the specified phase this is a no - op if the phase is already completed

public void begin step ( phase phase , step step ) { if ( ! is complete ( phase ) ) { lazy init step ( phase , step ) begin time = monotonic now ( ) ; } }


public < request , response > server call listener < request > intercept call ( server call < request , response > server call , metadata metadata , server call handler < request , response > server call handler ) { string token = metadata get ( auth head header name ) ; if ( expected token equals ( token ) ) { return server call handler start call ( server call , metadata ) ; } else { server call close ( status permission denied , new metadata ( ) ) ; return listener ; } }


returns an immutable multimap containing the given entries , in the " key - grouped " insertion order described in the < a href = " # iteration " > class documentation

public static < k , v > immutable multimap < k , v > of ( k k 1 , v v 1 , k k 2 , v v 2 , k k 3 , v v 3 , k k 4 , v v 4 , k k 5 , v v 5 ) { return immutable list multimap of ( k 1 , v 1 , k 2 , v 2 , k 3 , v 3 , k 4 , v 4 , k 5 , v 5 ) ; } / / looking for of ( ) with > 5 entries ? use the builder instead


records the eviction of an entry from the cache this should only been called when an entry is evicted due to the cache ' s eviction strategy , and not as a result of manual { @ link cache # invalidate invalidations }


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


post storeorder : place an order for a pet

com netflix hystrix hystrix command < response entity < order > > place order ( @ api param ( value = " order placed for purchasing the pet " , required = true ) @ valid @ request body order body ) ;


moves this file to the specified file , overwriting the file if it already exists @ throw gdx runtime exception if the source or destination file handle is a { @ link file type # classpath } or { @ link file type # internal } file

public void move to ( file handle dest ) { throw new gdx runtime exception ( " stub " ) ; }


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


verifies that s 3 : delete object version is not required for rename see hadoop - 17621 this test will only show a regression if the bucket has versioning enabled and s 3 guard is enabled

public void test rename permission requirements ( ) throws throwable { describe ( " verify rename ( ) only needs s 3 : delete object permission " ) ; / / close the existing role f s i o utils cleanup with logger ( log , role f s ) ; / / create an assumed role config which doesn ' t have / / s 3 : delete object version permission , and attempt rename / / and then delete configuration role config = create assumed role config ( ) ; bind role policy statements ( role config , statement s3guard client , statement allow sse kms rw , statement all bucket read access , / / root : r - x new statement ( effects allow ) / / dest : rwx add actions ( s3 path rw operations ) add resources ( directory ( base path ) ) , new statement ( effects deny ) add actions ( s3 delete object version ) add resources ( directory ( base path ) ) ) ; role f s = ( s 3 a file system ) base path get file system ( role config ) ; path src dir = new path ( base path , " src " ) ; path dest dir = new path ( base path , " dest " ) ; role f s mkdirs ( src dir ) ; / / the role fs has everything but that delete object version permission , so / / must be able to create files list < path > created files = create files ( role f s , src dir , dir depth , file count , dir count ) ; role f s rename ( src dir , dest dir ) ; role f s rename ( dest dir , src dir ) ; role f s delete ( src dir , true ) ; }


returns the number of started ssltls handshakes in client mode

public long connect ( ) { lock reader lock = context ctx lock read lock ( ) ; reader lock lock ( ) ; try { return s s l context session connect ( context ctx ) ; } finally { reader lock unlock ( ) ; } }


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


returns the used percentage of a disk this is useful in debugging disk usage

public float compute used percentage ( ) { return ( float ) ( get used ( ) ) / ( float ) ( get capacity ( ) ) ; }


public void visit invalid ( int opcode , int offset , int length ) ;


creates a unique id for the action shadowed by this extra action we need to have a unique id for the extra action to use we build this from the owner ' s label and the shadowed action id ( which is only guaranteed to be unique per target ) together with the subfolder matching the original target ' s package name , we believe this is enough of a uniqueness guarantee

public static string get action id ( action key context action key context , action owner owner , action action ) throws interrupted exception { fingerprint f = new fingerprint ( ) ; f add string ( owner get label ( ) to string ( ) ) ; immutable list < aspect descriptor > aspect descriptors = owner get aspect descriptors ( ) ; f add int ( aspect descriptors size ( ) ) ; for ( aspect descriptor aspect descriptor : aspect descriptors ) { f add string ( aspect descriptor get description ( ) ) ; } f add string ( action get key ( action key context , / * artifact expander = * / null ) ) ; return f hex digest and reset ( ) ; }


tests to determine if the passed object was created with the same parameters

public boolean equals ( final object obj ) { if ( ! ( obj instanceof vertex attribute ) ) { return false ; } return equals ( ( vertex attribute ) obj ) ; }


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


returns the canonical file path for this file

public string get canonical path ( ) throws i o exception { return resource get canonical path ( ) ; }


public string get db type ( ) { return data source proxy get db type ( ) ; }


use from a { @ link job # make search index } override

public final search index builder extend search index ( search index builder sib ) { if ( as job ( ) is buildable ( ) & & as job ( ) has permission ( item build ) ) { sib add ( " build " , " build " ) ; } return sib ; }


public static i p address intelligence response banned ( ) { return builder ( ) status ( i p address intelligence status banned ) score ( i p address intelligence status banned get score ( ) ) build ( ) ; }


returns how many total clusters the search was executed successfully on

public int get successful ( ) { return successful ; }


test proctime temporal join when set idle state retention

public void test proc time temporal join with state retention ( ) throws exception { final int min retention time = 10 ; final int max retention time = min retention time * 3 / 2 ; temporal process time join operator join operator = new temporal process time join operator ( row type , join condition , min retention time , max retention time , false ) ; keyed two input stream operator test harness < row data , row data , row data , row data > test harness = create test harness ( join operator ) ; test harness open ( ) ; test harness set processing time ( 1 ) ; test harness process element 1 ( insert record ( 1l , " 1a 1 " ) ) ; test harness set processing time ( 2 ) ; test harness process element 2 ( insert record ( 2l , " 2a 2 " ) ) ; test harness set processing time ( 3 ) ; test harness process element 1 ( insert record ( 2l , " 2a 3 " ) ) ; test harness set processing time ( 3 + max retention time ) ; test harness process element 1 ( insert record ( 2l , " 1a 5 " ) ) ; list < object > expected output = new array list < > ( ) ; expected output add ( insert record ( 2l , " 2a 3 " , 2l , " 2a 2 " ) ) ; assertor assert output equals ( " output wrong " , expected output , test harness get output ( ) ) ; test harness close ( ) ; }


returns the optimal number of threads to be used for av1 decoding

private native int gav 1 get threads ( ) ;


this test validates the correctness of { @ link r m web service protocol # create new reservation ( ) } inside router

public void test new reservation x m l ( ) throws exception { / / test with a wrong http method client response bad response = perform call ( rm web service path + reservation new , null , null , null , put ) ; assert equals ( sc internal server error , bad response get status ( ) ) ; / / test with the correct http method client response response = perform call ( rm web service path + reservation new , null , null , null , post ) ; assert equals ( sc ok , response get status ( ) ) ; new reservation ci = response get entity ( new reservation class ) ; assert not null ( ci ) ; }


get the name of the state store that should be queried

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


add a fragment of a class string , like " exception " or " java lang exc " , to identify a parameter type

public void add type identifier ( string identifier ) { this type identifiers add ( identifier ) ; }


flushes the underlying stream this forces any buffered output bytes to be written out to the stream

public void flush ( ) throws i o exception { out flush ( ) ; }


determines if the supplied class object represents a primitive type

static public boolean is primitive ( class c ) { return c is primitive ( ) ; }


create dir listing metadata with two dirs and one file living in directory ' parent '

private static dir listing metadata make two dirs one file ( path parent ) { path metadata path meta 1 = new path metadata ( new s 3 a file status ( true , new path ( parent , " dir 1 " ) , test owner ) ) ; path metadata path meta 2 = new path metadata ( new s 3 a file status ( true , new path ( parent , " dir 2 " ) , test owner ) ) ; path metadata path meta 3 = new path metadata ( new s 3 a file status ( 123 , 456 , new path ( parent , " file 1 " ) , 8192 , test owner , test etag , test version id ) ) ; list < path metadata > listing = arrays as list ( path meta 1 , path meta 2 , path meta 3 ) ; return new dir listing metadata ( parent , listing , false ) ; }


resolve a filename as a path ( suppressing forbidden a p is ) protected so tests can map string path - names to real path objects

protected path resolve path ( string name ) { return path utils get ( name ) normalize ( ) to absolute path ( ) ; }


validates taking the application - defined memory state backend and adding additional parameters from the cluster configuration

public void test configure memory state backend ( ) throws exception { final string checkpoint dir = new path ( tmp new folder ( ) to u r i ( ) ) to string ( ) ; final string savepoint dir = new path ( tmp new folder ( ) to u r i ( ) ) to string ( ) ; final path expected checkpoint path = new path ( checkpoint dir ) ; final path expected savepoint path = new path ( savepoint dir ) ; final int max size = 100 ; final boolean async = ! checkpointing options async snapshots default value ( ) ; final memory state backend backend = new memory state backend ( max size , async ) ; final configuration config = new configuration ( ) ; config set string ( backend key , " filesystem " ) ; / / check that this is not accidentally picked up config set string ( checkpointing options checkpoints directory , checkpoint dir ) ; config set string ( checkpointing options savepoint directory , savepoint dir ) ; config set boolean ( checkpointing options async snapshots , ! async ) ; state backend loaded backend = state backend loader from application or config or default ( backend , config , cl , null ) ; assert true ( loaded backend instanceof memory state backend ) ; final memory state backend mem backend = ( memory state backend ) loaded backend ; assert equals ( expected checkpoint path , mem backend get checkpoint path ( ) ) ; assert equals ( expected savepoint path , mem backend get savepoint path ( ) ) ; assert equals ( max size , mem backend get max state size ( ) ) ; assert equals ( async , mem backend is using asynchronous snapshots ( ) ) ; }


the nonce provides a way for incremental mesh config requests to uniquely reference an incremental mesh config response the nonce is required < code > string nonce = 4 ; < code >

com google protobuf byte string get nonce bytes ( ) ;


public static string get message ( string message ) { return message ; }


returns the offset of the first byte within the backing byte array of this buffer


a sensible definition of { @ link # first entry ( ) } in terms of { @ code entry set ( ) iterator ( ) } if you override { @ link # entry set ( ) } , you may wish to override { @ link # first entry ( ) } to forward to this implementation

protected entry < e > standard first entry ( ) { iterator < entry < e > > entry iterator = entry set ( ) iterator ( ) ; if ( ! entry iterator has next ( ) ) { return null ; } entry < e > entry = entry iterator next ( ) ; return multisets immutable entry ( entry get element ( ) , entry get count ( ) ) ; }


add char filter setting that will be used on top of a tokenizer provided

public analyze request builder add char filter ( map < string , ? > char filter ) { request add char filter ( char filter ) ; return this ; }


serializes the given metrics and returns the resulting byte array should a { @ link metric } accessed in this method throw an exception it will be omitted from the returned { @ link metric serialization result } if the serialization of any primitive or string fails then the returned { @ link metric serialization result } is partially corrupted such a result can be deserialized safely by { @ link metric dump deserializer # deserialize ( metric serialization result ) } ; however only metrics that were fully serialized before the failure will be returned

public metric serialization result serialize ( map < counter , tuple 2 < query scope info , string > > counters , map < gauge < ? > , tuple 2 < query scope info , string > > gauges , map < histogram , tuple 2 < query scope info , string > > histograms , map < meter , tuple 2 < query scope info , string > > meters ) { counters buffer clear ( ) ; int num counters = 0 ; for ( map entry < counter , tuple 2 < query scope info , string > > entry : counters entry set ( ) ) { try { serialize counter ( counters buffer , entry get value ( ) f 0 , entry get value ( ) f 1 , entry get key ( ) ) ; num counters + + ; } catch ( exception e ) { log debug ( " failed to serialize counter " , e ) ; } } gauges buffer clear ( ) ; int num gauges = 0 ; for ( map entry < gauge < ? > , tuple 2 < query scope info , string > > entry : gauges entry set ( ) ) { try { serialize gauge ( gauges buffer , entry get value ( ) f 0 , entry get value ( ) f 1 , entry get key ( ) ) ; num gauges + + ; } catch ( exception e ) { log debug ( " failed to serialize gauge " , e ) ; } } histograms buffer clear ( ) ; int num histograms = 0 ; for ( map entry < histogram , tuple 2 < query scope info , string > > entry : histograms entry set ( ) ) { try { serialize histogram ( histograms buffer , entry get value ( ) f 0 , entry get value ( ) f 1 , entry get key ( ) ) ; num histograms + + ; } catch ( exception e ) { log debug ( " failed to serialize histogram " , e ) ; } } meters buffer clear ( ) ; int num meters = 0 ; for ( map entry < meter , tuple 2 < query scope info , string > > entry : meters entry set ( ) ) { try { serialize meter ( meters buffer , entry get value ( ) f 0 , entry get value ( ) f 1 , entry get key ( ) ) ; num meters + + ; } catch ( exception e ) { log debug ( " failed to serialize meter " , e ) ; } } return new metric serialization result ( counters buffer get copy of buffer ( ) , gauges buffer get copy of buffer ( ) , meters buffer get copy of buffer ( ) , histograms buffer get copy of buffer ( ) , num counters , num gauges , num meters , num histograms ) ; }


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


public short get instruction ( ) { if ( ! etb is moveable ( ) ) { throw new runtime exception ( " entry point is not moveable ! " ) ; } return instruction ; }