checks whether the form is modified by comparing to the config

private boolean check form modified ( final m t base config < m t form , m t config > config ) { return objects require non null ( get form ( ) ) is modified ( config ) ; }


return the key for the current join or the value at the top of the record reader heap

public k key ( ) { if ( jc has next ( ) ) { return jc key ( ) ; } if ( ! q is empty ( ) ) { return q peek ( ) key ( ) ; } return null ; }


lower level functions to write records individually after this function is called { @ link # write field ( string ) } must be called < code > num fields < code > times

public void write num fields ( int num fields ) throws i o exception { / / number fields length buffer clear ( ) ; length buffer put int ( num fields ) ; output stream write ( length buffer array ( ) ) ; }


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

public void test activies x m l ( ) throws exception { list < activities info > responses = perform get calls ( rm web service path + scheduler activities , activities info class , null , null ) ; activities info router response = responses get ( 0 ) ; activities info rm response = responses get ( 1 ) ; assert not null ( router response ) ; assert not null ( rm response ) ; }


sort nodes array by network distance to reader as an additional twist , we also randomize the nodes at each network distance this helps with load balancing when there is data skew and it helps choose node with more fast storage type

private < t extends node > void sort by distance ( node reader , t [ ] nodes , int active len , consumer < list < t > > secondary sort , boolean non data node reader ) {


creates a nodes info request against one or more nodes pass { @ code null } or an empty array for all nodes

public static nodes info request nodes info request ( string nodes ids ) { return new nodes info request ( nodes ids ) ; }


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

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


< code > replace external data type < code > replaces the data type of the external label in program 1 with the data type of the external label in program 2 at the specified external space address

public void replace external data type ( external location result external location , external location from external location , task monitor monitor ) throws cancelled exception { monitor check canceled ( ) ; if ( from external location ! = null & & result external location ! = null ) { data type from data type for result = get result data type ( from external location ) ; data type result data type = result external location get data type ( ) ; if ( is same data type ( from data type for result , result data type ) ) { return ; / / already the same } result external location set data type ( from data type for result ) ; } }


receive synced distro data , find processor to process

public boolean on receive ( distro data distro data ) { string resource type = distro data get distro key ( ) get resource type ( ) ; distro data processor data processor = distro component holder find data processor ( resource type ) ; if ( null = = data processor ) { loggers distro warn ( " [ distro ] can ' t find data process for received data { } " , resource type ) ; return false ; } return data processor process data ( distro data ) ; }


decrements the count - down and returns < code > true < code > iff this call reached zero otherwise < code > false < code >

public boolean count down ( ) { assert original count > 0 ; for ( ; ; ) { final int current = count down get ( ) ; assert current > = 0 ; if ( current = = 0 ) { return false ; } if ( count down compare and set ( current , current - 1 ) ) { return current = = 1 ; } } }


< code > optional string product = 2 ; < code >

private void set product 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 2 ; product = value to string utf 8 ( ) ; }


expire all { @ link hashed wheel timeout } s for the given { @ code deadline }

void expire timeouts ( long deadline ) { hashed wheel timeout timeout = head ; / / process all timeouts while ( timeout ! = null ) { hashed wheel timeout next = timeout next ; if ( timeout remaining rounds < = 0 ) { next = remove ( timeout ) ; if ( timeout deadline < = deadline ) { timeout expire ( ) ; } else { / / the timeout was placed into a wrong slot this should never happen throw new illegal state exception ( string format ( " timeout deadline ( % d ) > deadline ( % d ) " , timeout deadline , deadline ) ) ; } } else if ( timeout is cancelled ( ) ) { next = remove ( timeout ) ; } else { timeout remaining rounds - - ; } timeout = next ; } }


tests that audit logger works as expected

public void test audit logger ( ) throws i o exception { configuration conf = new hdfs configuration ( ) ; conf set ( dfs namenode audit loggers key , dummy audit logger class get name ( ) ) ; mini d f s cluster cluster = new mini d f s cluster builder ( conf ) build ( ) ; try { cluster wait cluster up ( ) ; assert true ( dummy audit logger initialized ) ; dummy audit logger reset log count ( ) ; file system fs = cluster get file system ( ) ; long time = system current time millis ( ) ; fs set times ( new path ( " / " ) , time , time ) ; assert equals ( 1 , dummy audit logger log count ) ; } finally { cluster shutdown ( ) ; } }


returns the absolute uri of the class - path entry value as specified in < a href = " http : docs oracle comjavase 8docstechnotesguidesjarjar html # main attributes " > jar file specification even though the specification only talks about relative urls , absolute urls are actually supported too ( for example , in maven surefire plugin )

static url get class path entry ( file jar file , string path ) throws malformed u r l exception { return new url ( jar file to u r i ( ) to u r l ( ) , path ) ; }


adds a node if a node of the same name already exists then that node will be replaced

public void add node ( final @ non null node node ) throws i o exception { if ( enforce name restrictions ) { jenkins check good name ( node get node name ( ) ) ; } node old node = nodes get ( node get node name ( ) ) ; if ( node ! = old node ) { / / todo we should not need to lock the queue for adding nodes but until we have a way to update the / / computer list for just the new node atomic reference < node > old = new atomic reference < > ( ) ; queue with lock ( new runnable ( ) { @ override public void run ( ) { old set ( nodes put ( node get node name ( ) , node ) ) ; jenkins update computer list ( ) ; jenkins trim labels ( ) ; } } ) ; / / todo there is a theoretical race whereby the node instance is updated / removed after lock release try { persist node ( node ) ; } catch ( i o exception | runtime exception e ) { / / jenkins - 50599 : if persisting the node throws an exception , we need to remove the node from / / memory before propagating the exception queue with lock ( new runnable ( ) { @ override public void run ( ) { nodes compute ( node get node name ( ) , ( ignored node name , ignored node ) - > old node ) ; jenkins update computer list ( ) ; jenkins trim labels ( ) ; } } ) ; throw e ; } if ( old get ( ) ! = null ) { node listener fire on updated ( old get ( ) , node ) ; } else { node listener fire on created ( node ) ; } } }


a meaningless value used to test that plugin suggesters can add fields to their options

public string get dummy ( ) { return dummy ; }


converts an swt based image into an awt < code > buffered image < code > this will always return a < code > buffered image < code > that is of type < code > buffered image type int argb < code > regardless of the type of swt image that is passed into the method

public static buffered image convert ( image src image ) { return convert from image data ( src image get image data ( ) ) ; }


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


register by class name sacrificing a bit of efficiency to solve the problem that the main dex file size is too large

private static void register ( string class name ) { if ( ! text utils is empty ( class name ) ) { try { class < ? > clazz = class for name ( class name ) ; object obj = clazz get constructor ( ) new instance ( ) ; if ( obj instanceof i route root ) { register route root ( ( i route root ) obj ) ; } else if ( obj instanceof i provider group ) { register provider ( ( i provider group ) obj ) ; } else if ( obj instanceof i interceptor group ) { register interceptor ( ( i interceptor group ) obj ) ; } else { logger info ( tag , " register failed , class name : " + class name + " should implements one of i route root / i provider group / i interceptor group " ) ; } } catch ( exception e ) { logger error ( tag , " register class error : " + class name , e ) ; } } }


return whether object 1 is equals to object 2

public static boolean equals ( final object o 1 , final object o 2 ) { return o 1 = = o 2 | | ( o 1 ! = null & & o 1 equals ( o 2 ) ) ; }


register the given auto - completion listener

public void add autocompletion listener ( autocompletion listener < t > l ) { autocompletion listeners add ( l ) ; }


log the status this is done progressively less frequently as the job processes more data logging every 10000 records when the data rate is 40000 per second quickly rolls the logs

protected boolean log status ( long total records ) { if ( + + log count % log every ! = 0 ) { return false ; } string status = string format ( locale root , " [ % s ] % d records written to autodetect ; missing field count = % d , invalid date count = % d , out of order count = % d " , job get id ( ) , get processed record count ( ) , get missing field error count ( ) , get date parse errors count ( ) , get out of order record count ( ) ) ; logger info ( status ) ; int log 1 0 total records = ( int ) math floor ( math log 1 0 ( total records ) ) ; / / start reducing the logging rate after a million records have been seen if ( log 1 0 total records > 5 ) { log every = ( int ) math pow ( 10 0 , log 1 0 total records - 5 ) ; log count = 0 ; } return true ; }


gets an unmodifiable view of the set of dependencies in { @ link path } form from this dependency set instance

public collection < path > get dependencies ( ) { return collections unmodifiable collection ( dependencies ) ; }


tests that if we have received a slot report with some allocated slots , then we don ' t accept slot requests with allocated allocation ids

public void test duplicate pending slot request after slot report ( ) throws exception { final resource manager id resource manager id = resource manager id generate ( ) ; final resource actions resource manager actions = new testing resource actions builder ( ) build ( ) ; final task executor connection task manager connection = create task executor connection ( ) ; final resource i d resource i d = task manager connection get resource i d ( ) ; final job i d job id = new job i d ( ) ; final allocation i d allocation id = new allocation i d ( ) ; final resource profile resource profile = resource profile from resources ( 1 0 , 1 ) ; final slot i d slot id = new slot i d ( resource i d , 0 ) ; final slot status slot status = new slot status ( slot id , resource profile , job id , allocation id ) ; final slot report slot report = new slot report ( slot status ) ; final slot request slot request = new slot request ( job id , allocation id , resource profile , " foobar " ) ; try ( slot manager slot manager = create slot manager ( resource manager id , resource manager actions ) ) { slot manager register task manager ( task manager connection , slot report , resource profile any , resource profile any ) ; assert false ( slot manager register slot request ( slot request ) ) ; } }


return the int value with the given property name

public int get int ( string property name , int default value ) { pair < property entry type , string > pair = map get ( property name ) ; if ( pair = = null | | pair first ! = property entry type int type ) { return default value ; } try { string value = pair second ; return integer parse int ( value ) ; } catch ( number format exception e ) { return default value ; } }


public static string format ( date value ) { return standard date format get ( ) format ( value ) ; }


get method desc int do ( int arg 1 ) = > " do ( i ) i " void do ( string arg 1 , boolean arg 2 ) = > " do ( ljavalang string ; z ) v "

public static string get desc ( final method m ) { string builder ret = new string builder ( m get name ( ) ) append ( ' ( ' ) ; class < ? > [ ] parameter types = m get parameter types ( ) ; for ( int i = 0 ; i < parameter types length ; i + + ) { ret append ( get desc ( parameter types [ i ] ) ) ; } ret append ( ' ) ' ) append ( get desc ( m get return type ( ) ) ) ; return ret to string ( ) ; }


handle the given runtime exception thrown by the cache provider when updating an item with the specified { @ code key } and { @ code value } , possibly rethrowing it as a fatal exception

void handle cache put error ( runtime exception exception , cache cache , object key , @ nullable object value ) ;


get the ultimate target object of the supplied { @ code candidate } object , unwrapping not only a top - level proxy but also any number of nested proxies if the supplied { @ code candidate } is a spring { @ linkplain aop utils # is aop proxy proxy } , the ultimate target of all nested proxies will be returned ; otherwise , the { @ code candidate } will be returned as is

public static < t > t get ultimate target object ( object candidate ) { assert not null ( candidate , " candidate must not be null " ) ; try { if ( aop utils is aop proxy ( candidate ) & & candidate instanceof advised ) { object target = ( ( advised ) candidate ) get target source ( ) get target ( ) ; if ( target ! = null ) { return ( t ) get ultimate target object ( target ) ; } } } catch ( throwable ex ) { throw new illegal state exception ( " failed to unwrap proxied object " , ex ) ; } return ( t ) candidate ; }


sets the size ( in dp ) of the value - text for all data sets this data object contains

public void set value text size ( float size ) { for ( i data set set : m data sets ) { set set value text size ( size ) ; } }


public nullable shape get nullable shape ( ) { return nullable shape or else ( null ) ; }


public void small camel test ( ) { / / todo : test small camel }


finds a { @ link test item } given a { @ link litho view } based on the test key it was assigned during construction example use : { @ code final litho view litho view = component test helper mount component ( m context , new inline layout spec ( ) { @ override protected component layout on create layout ( component context c ) { return column create ( c ) child ( column create ( c ) child ( simple mount spec tester create ( c ) ) child ( simple mount spec tester create ( c ) ) test key ( " mytestkey " ) ) build ( ) ; } } ) ; final test item test item = litho view test helper find test item ( litho view , " mytestkey " ) ; }

public static deque < test item > find test items ( litho view litho view , string test key ) { return litho view find test items ( test key ) ; }


public section get old section ( ) { return m old section ; }


public short get short value ( ) { throw new illegal field access exception ( ) ; }


protected void create default decision states ( final flow flow ) { create service unauthorized check decision state ( flow ) ; create service check decision state ( flow ) ; create warn decision state ( flow ) ; create gateway request check decision state ( flow ) ; create has service check decision state ( flow ) ; create renew check action state ( flow ) ; }


boolean is null ( int channel , int position ) ;


returns { @ code true } if the state is initialized

public boolean initialized ( ) { return state = = state initialized ; }


the timetamp in driver time of this query

public long get timestamp ( ) { return this timestamp ; }


recovers a pending file for finalizing and committing

pending file recover pending file ( final in progress file writer pending file recoverable pending file recoverable ) throws i o exception ;


delete user { username } : delete user this can only be done by the logged in user

public response entity < void > delete user ( @ api param ( value = " the name that needs to be deleted " , required = true ) @ path variable ( " username " ) string username ) { return delegate delete user ( username ) ; }


execute sql scripts configured via { @ link sql @ sql } for the supplied { @ link test context } before the current test method

public void before test method ( test context test context ) { execute sql scripts ( test context , execution phase before test method ) ; }


returns whether or not the type of the compatibility is { @ link type # compatible after migration }

public boolean is compatible after migration ( ) { return result type = = type compatible after migration ; }


a sensible definition of { @ link # to array ( ) } in terms of { @ link # to array ( object [ ] ) } if you override { @ link # to array ( object [ ] ) } , you may wish to override { @ link # to array } to forward to this implementation

protected object [ ] standard to array ( ) { object [ ] new array = new object [ size ( ) ] ; return to array ( new array ) ; }


gets the largest timestamp that still belongs to this window this timestamp is identical to { @ code get end ( ) - 1 }

public long max timestamp ( ) { return end - 1 ; }


schedule the given { @ link runnable } , invoking it whenever the trigger indicates a next execution time execution will end once the scheduler shuts down or the returned { @ link scheduled future } gets cancelled

scheduled future < ? > schedule ( runnable task , trigger trigger ) ;


returns the tool event name corresponding to the given plugin event class if no corresponding tool event exists , null will be returned

public static string lookup tool event name ( class < ? > plugin event class ) { tool event name event name annotation = plugin event class get annotation ( tool event name class ) ; if ( event name annotation ! = null ) { return event name annotation value ( ) ; } return null ; }


creates a string containing html tags to represent the integer number in color

public static string get number string ( int count ) { return color string ( number color , integer to string ( count ) ) ; }


set a custom port number for the target service

public api client set port ( int port ) { this port = port ; return this ; }


updates the event dispatcher and returns whether the event should be dispatched

private boolean maybe update event dispatcher ( int child window index , @ nullable media source media period id child media period id ) { @ nullable media source media period id media period id = null ; if ( child media period id ! = null ) { media period id = get media period id for child media period id ( id , child media period id ) ; if ( media period id = = null ) { / / media period not found ignore event return false ; } } int window index = get window index for child window index ( id , child window index ) ; if ( media source event dispatcher window index ! = window index | | ! util are equal ( media source event dispatcher media period id , media period id ) ) { media source event dispatcher = media source list this media source event dispatcher with parameters ( window index , media period id , / * media time offset ms = * / 0l ) ; } if ( drm event dispatcher window index ! = window index | | ! util are equal ( drm event dispatcher media period id , media period id ) ) { drm event dispatcher = media source list this drm event dispatcher with parameters ( window index , media period id ) ; } return true ; }


extract a normalized simple comparison between a qualified name reference and a native value if possible

private optional < normalized simple comparison > to normalized simple comparison ( operator type operator type , row expression left expression , row expression right expression ) { object left ; object right ; if ( left expression instanceof variable reference expression ) { left = left expression ; } else { left = new row expression interpreter ( left expression , metadata , session , optimized ) optimize ( ) ; } if ( right expression instanceof variable reference expression ) { right = right expression ; } else { right = new row expression interpreter ( right expression , metadata , session , optimized ) optimize ( ) ; } if ( left instanceof row expression = = right instanceof row expression ) { / / we expect one side to be row expression and other to be value return optional empty ( ) ; } row expression expression ; operator type comparison operator ; nullable value value ; if ( left instanceof row expression ) { expression = left expression ; comparison operator = operator type ; value = new nullable value ( right expression get type ( ) , right ) ; } else { expression = right expression ; comparison operator = flip ( operator type ) ; value = new nullable value ( left expression get type ( ) , left ) ; } return optional of ( new normalized simple comparison ( expression , comparison operator , value ) ) ; }


returns the handler for the given method and version if a handler for given version do not exist , a handler for version current will be returned the reasoning behind is that in a minor a new api could be added passively , therefore new a p is are compatible ( as opposed to non - compatiblebreaking ) or { @ code null } if none exists

rest handler get handler ( rest request method method , version version ) { map < version , rest handler > version to handlers = method handlers get ( method ) ; if ( version to handlers = = null ) { return null ; / / method not found } final rest handler handler = version to handlers get ( version ) ; return handler = = null ? version to handlers get ( version current ) : handler ; }


reports the current slot allocations for a task manager identified by the given instance id

public boolean report slot status ( instance i d instance id , slot report slot report ) { check init ( ) ; task manager registration task manager registration = task manager registrations get ( instance id ) ; if ( null ! = task manager registration ) { log debug ( " received slot report from instance { } : { } " , instance id , slot report ) ; for ( slot status slot status : slot report ) { update slot ( slot status get slot i d ( ) , slot status get allocation i d ( ) , slot status get job i d ( ) ) ; } return true ; } else { log debug ( " received slot report for unknown task manager with instance id { } ignoring this report " , instance id ) ; return false ; } }


returns the index for the given address if the address is not mapped , null will be returned

public big integer get index ( address addr ) { int arr index = arrays binary search ( address list , addr ) ; if ( arr index > = 0 ) { return index list [ arr index ] ; } arr index = - arr index - 2 ; if ( arr index < 0 ) { return null ; } if ( ! ( addr get address space ( ) equals ( address list [ arr index ] get address space ( ) ) ) ) { return null ; } big integer offset = addr get offset as big integer ( ) subtract ( address list [ arr index ] get offset as big integer ( ) ) ; big integer index = index list [ arr index ] add ( offset ) ; if ( index compare to ( index list [ arr index + 1 ] ) > = 0 ) { return null ; } return index ; }


{ @ inherit doc } the implementation for { @ link rule tag token } always returns { @ code null }

public token source get token source ( ) { return null ; }


calls { @ link channel handler context # flush ( ) } to forward to the next { @ link channel outbound handler } in the { @ link channel pipeline } sub - classes may override this method to change behavior

public void flush ( channel handler context ctx ) throws exception { ctx flush ( ) ; }


return string representing the parent of the given path

string get parent ( string path ) { return path substring ( 0 , path last index of ( path separator ) ) ; }


capture a snapshot for cross - thread propagation it ' s a similar concept with active span continuation in open tracing - java how to build , depends on the implementation


test of view method , of class data descriptor

public void test view 0args ( ) { data descriptor view = data descriptor allocate ( ) ; int exp size = zip input stream exthdr ; int exp pos = 0 ; int exp marker = ( int ) zip input stream extsig ; assert with message ( " no marker " ) that ( view has marker ( ) ) is true ( ) ; assert with message ( " no marker " ) that ( view get ( extsig ) ) is equal to ( exp marker ) ; assert with message ( " not at position 0 " ) that ( view buffer position ( ) ) is equal to ( exp pos ) ; assert with message ( " not sized correctly " ) that ( view get size ( ) ) is equal to ( exp size ) ; assert with message ( " not limited to size " ) that ( view buffer limit ( ) ) is equal to ( exp size ) ; }


the list of array elements < code > repeated aapt pb array element element = 1 ; < code >

private void clear element ( ) { element = empty protobuf list ( ) ; }


ensures that the current user can read the specified response without actually reading it

public void authorize response ( async execution id async execution id , boolean restore response headers , action listener < r > listener ) { get encoded response ( async execution id , restore response headers , action listener wrap ( ( t ) - > listener on response ( null ) , listener : : on failure ) ) ; }


a useful placeholder for { @ link checked function } s that want to always return { @ code true }

protected boolean always replace resource ( final response response ) { return true ; }


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


note : if the parameter inputted is empty then will return the empty list

public list < instance > generate instances by ips ( string service name , string raw product name , string cluster name , string [ ] ip array ) { if ( string utils is empty ( service name ) | | string utils is empty ( cluster name ) | | ip array = = null | | ip array length = = 0 ) { return collections empty list ( ) ; } list < instance > instance list = new array list < > ( ip array length ) ; for ( string ip : ip array ) { string [ ] ip and port = generate ip and port ( ip ) ; instance instance = new instance ( ) ; instance set ip ( ip and port [ 0 ] ) ; instance set port ( integer parse int ( ip and port [ 1 ] ) ) ; instance set cluster name ( cluster name ) ; instance set service name ( service name ) ; instance set tenant ( constants default namespace id ) ; instance set app ( raw product name ) ; instance set ephemeral ( false ) ; instance list add ( instance ) ; } return instance list ; }


create a builder with the template name , status code , headers and model of the given response

static builder from ( rendering response other ) { return new default rendering response builder ( other ) ; }


{ @ code provides with count } indicates the number of entries in the { @ code provides with index } table

public int get provides with count ( ) { return provides with count & 0xffff ; }


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


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

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


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 function name : return is set function name ( ) ; } throw new illegal state exception ( ) ; }


creates a random volume for testing purpose

public disk balancer volume create random volume ( storage type type ) { disk balancer volume volume = new disk balancer volume ( ) ; volume set path ( " / tmp / disk / " + get random name ( 10 ) ) ; volume set storage type ( type to string ( ) ) ; volume set transient ( type is transient ( ) ) ; volume set capacity ( get random capacity ( ) ) ; volume set reserved ( get random reserved ( volume get capacity ( ) ) ) ; volume set used ( get random dfs used ( volume get capacity ( ) , volume get reserved ( ) ) ) ; volume set uuid ( uuid random u u i d ( ) to string ( ) ) ; return volume ; }


pre fill type build ( ) { return new pre fill type ( width , height , config , weight ) ; }


count the records lite pal count ( person class ) ; this will count all rows in person table < br > you can also specify a where clause when counting lite pal where ( & quot ; age & gt ; ? & quot ; , & quot ; 15 & quot ; ) count ( person class ) ;

public int count ( class < ? > model class ) { return count ( base utility change case ( model class get simple name ( ) ) ) ; }


take a string where a null value is remapped to an empty string

private static string null to empty string ( final string src ) { return src = = null ? " " : src ; }


generates the default log message of the specified event whose argument is an arbitrary object

private static string format simple ( channel handler context ctx , string event name , object msg ) { string ch str = ctx channel ( ) to string ( ) ; string msg str = string value of ( msg ) ; string builder buf = new string builder ( ch str length ( ) + 1 + event name length ( ) + 2 + msg str length ( ) ) ; return buf append ( ch str ) append ( ' ' ) append ( event name ) append ( " : " ) append ( msg str ) to string ( ) ; }


gets the index of the given reference , which must have been added to this instance

public int index of ( cst field ref ref ) { if ( ref = = null ) { throw new null pointer exception ( " ref = = null " ) ; } throw if not prepared ( ) ; field id item item = field ids get ( ref ) ; if ( item = = null ) { throw new illegal argument exception ( " not found " ) ; } return item get index ( ) ; }


returns a string printing p i ds of process present in the procfs based process tree output format : [ pid pid ]

public string to string ( ) { string buffer p tree = new string buffer ( " [ " ) ; for ( string p : process tree key set ( ) ) { p tree append ( p ) ; p tree append ( " " ) ; } return p tree substring ( 0 , p tree length ( ) ) + " ] " ; }


returns true , if the aggregator value is zero , false otherwise

public boolean is converged ( int iteration , double value value ) { return value get value ( ) = = 0 ; }


public builder shared ( @ nullable boolean shared ) { if ( shared ! = null ) return shared ( ( boolean ) shared ) ; flags & = ~ ( flag shared set | flag shared ) ; return this ; }


creates a { @ link maybe observer } wrapper around a { @ link observer } history : 2 1 11 - experimental

public static < t > maybe observer < t > create ( observer < ? super t > downstream ) { return new maybe to observable observer < > ( downstream ) ; }


public static thread new thread ( string name , runnable runnable , boolean daemon ) { thread thread = new thread ( runnable , name ) ; thread set daemon ( daemon ) ; thread set uncaught exception handler ( new thread uncaught exception handler ( ) { public void uncaught exception ( thread t , throwable e ) { log error ( " uncaught exception in thread ' " + t get name ( ) + " ' : " , e ) ; } } ) ; return thread ; }


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


private void append remainder ( ) { if ( iter get index ( ) < iter get length ( ) ) { genericized string append ( iter get string ( ) substring ( iter get index ( ) ) ) ; } }


constructs a readable description of the current position in this word reader and its included word reader objects

public string location description ( ) { return ( include word reader = = null ? ( current word = = null ? " end of " : " ' " + current word + " ' in " ) : ( include word reader location description ( ) + " , \ n " + " included from " ) ) + line location description ( ) ; }


public void set older than ( long older than ) { if ( newer than ! = null ) { throw new unsupported operation exception ( " cannot set ' older than ' ' newer than ' already set " ) ; } this older than = older than ; }


returns the total size of the parameters

public static int get parameter size ( method method ) { method optimization info info = method optimization info get method optimization info ( method ) ; return info ! = null ? info get parameter size ( ) : 0 ; }


returns true if field e is set ( has been assigned a value ) and false otherwise

public boolean is set e ( ) { return this e ! = null ; }


build call for fake outer number serialize

public okhttp 3 call fake outer number serialize call ( big decimal body , final api callback callback ) throws api exception { object local var post body = body ; / / create path and map variables api operation api operation = local var api client get operation lookup map ( ) get ( " fake outer number serialize " ) ; if ( api operation = = null ) { throw new api exception ( " operation not found in oas " ) ; } operation operation = api operation get operation ( ) ; string local var path = api operation get path ( ) ; map < string , object > param map = new hash map < > ( ) ; list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; local var path = local var api client fill parameters from operation ( operation , param map , local var path , local var query params , local var collection query params , local var header params , local var cookie params ) ; final string [ ] local var accepts = { " * / * " } ; final string local var accept = local var api client select header accept ( local var accepts ) ; if ( local var accept ! = null ) { local var header params put ( " accept " , local var accept ) ; } final string [ ] local var content types = { } ; final string local var content type = local var api client select header content type ( local var content types ) ; local var header params put ( " content - type " , local var content type ) ; string [ ] local var auth names = new string [ ] { } ; return local var api client build call ( local var path , api operation get method ( ) , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var auth names , callback ) ; }


records the successful load of a new entry this should be called when a cache request causes an entry to be loaded , and the loading completes successfully in contrast to { @ link # record misses } , this method should only be called by the loading thread

void record load success ( long load time ) ;


deletes a topic and blocks for max 30 sec until the topic got deleted

public void delete topic and wait ( final string topic ) throws interrupted exception { delete topics and wait ( topic deletion timeout , topic ) ; }


returns the int value associated with the given index

public int get value ( long index ) { try { return map get int ( index ) ; } catch ( no value exception e ) { try { index = map get previous property index ( index ) ; return map get int ( index ) ; } catch ( no such index exception ex ) { } catch ( no value exception ex ) { } } return 0 ; }


public statement create statement ( ) throws s q l exception { throw new s q l exception ( " simulated exception in create statement ( ) " ) ; }


set the given property to < code > pattern < code > if the pattern is passed as null , sets the empty pattern which results in further calls to get pattern ( ) returning the default value

public void set pattern ( string name , pattern pattern ) { assert pattern ! = null : " pattern cannot be null " ; set ( name , pattern pattern ( ) ) ; }


test the property ' prefix wrapped array '

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


puts a long into this byte vector the byte vector is automatically enlarged if necessary

public byte vector put long ( final long long value ) { int current length = length ; if ( current length + 8 > data length ) { enlarge ( 8 ) ; } byte [ ] current data = data ; int int value = ( int ) ( long value > > > 32 ) ; current data [ current length + + ] = ( byte ) ( int value > > > 24 ) ; current data [ current length + + ] = ( byte ) ( int value > > > 16 ) ; current data [ current length + + ] = ( byte ) ( int value > > > 8 ) ; current data [ current length + + ] = ( byte ) int value ; int value = ( int ) long value ; current data [ current length + + ] = ( byte ) ( int value > > > 24 ) ; current data [ current length + + ] = ( byte ) ( int value > > > 16 ) ; current data [ current length + + ] = ( byte ) ( int value > > > 8 ) ; current data [ current length + + ] = ( byte ) int value ; length = current length ; return this ; }


size of byte to fit size of memory to three decimal places

public static string byte 2 fit memory size ( final long byte size , int precision ) { if ( precision < 0 ) { throw new illegal argument exception ( " precision shouldn ' t be less than zero ! " ) ; } if ( byte size < 0 ) { throw new illegal argument exception ( " byte size shouldn ' t be less than zero ! " ) ; } else if ( byte size < memory constants kb ) { return string format ( " % " + precision + " f b " , ( double ) byte size ) ; } else if ( byte size < memory constants mb ) { return string format ( " % " + precision + " f k b " , ( double ) byte size / memory constants kb ) ; } else if ( byte size < memory constants gb ) { return string format ( " % " + precision + " f m b " , ( double ) byte size / memory constants mb ) ; } else { return string format ( " % " + precision + " f g b " , ( double ) byte size / memory constants gb ) ; } }


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


case insensitive lookup by protocol name

public static security protocol for name ( string name ) { return security protocol value of ( name to upper case ( locale root ) ) ; }


this method creates a snapshot info from internal x - content it does not handle x - content written with the external version as external x - content is only for display purposes and does not need to be parsed

public static snapshot info from x content internal ( final x content parser parser ) throws i o exception { string name = null ; string uuid = null ; version version = version current ; snapshot state state = snapshot state in progress ; string reason = null ; list < string > indices = collections empty list ( ) ; list < string > data streams = collections empty list ( ) ; long start time = 0 ; long end time = 0 ; int total shards = 0 ; int successful shards = 0 ; boolean include global state = null ; map < string , object > user metadata = null ; list < snapshot shard failure > shard failures = collections empty list ( ) ; if ( parser current token ( ) = = null ) { / / fresh parser ? move to the first token parser next token ( ) ; } if ( parser current token ( ) = = x content parser token start object ) { / / on a start object move to next token parser next token ( ) ; } x content parser token token ; x content parser utils ensure expected token ( x content parser token start object , parser next token ( ) , parser ) ; string current field name = parser current name ( ) ; if ( snapshot equals ( current field name ) ) { while ( ( token = parser next token ( ) ) ! = x content parser token end object ) { if ( token = = x content parser token field name ) { current field name = parser current name ( ) ; token = parser next token ( ) ; if ( token is value ( ) ) { if ( name equals ( current field name ) ) { name = parser text ( ) ; } else if ( uuid equals ( current field name ) ) { uuid = parser text ( ) ; } else if ( state equals ( current field name ) ) { state = snapshot state value of ( parser text ( ) ) ; } else if ( reason equals ( current field name ) ) { reason = parser text ( ) ; } else if ( start time equals ( current field name ) ) { start time = parser long value ( ) ; } else if ( end time equals ( current field name ) ) { end time = parser long value ( ) ; } else if ( total shards equals ( current field name ) ) { total shards = parser int value ( ) ; } else if ( successful shards equals ( current field name ) ) { successful shards = parser int value ( ) ; } else if ( version id equals ( current field name ) ) { version = version from id ( parser int value ( ) ) ; } else if ( include global state equals ( current field name ) ) { include global state = parser boolean value ( ) ; } } else if ( token = = x content parser token start array ) { if ( data streams equals ( current field name ) ) { data streams = new array list < > ( ) ; while ( parser next token ( ) ! = x content parser token end array ) { data streams add ( parser text ( ) ) ; } } else if ( indices equals ( current field name ) ) { array list < string > indices array = new array list < > ( ) ; while ( parser next token ( ) ! = x content parser token end array ) { indices array add ( parser text ( ) ) ; } indices = collections unmodifiable list ( indices array ) ; } else if ( failures equals ( current field name ) ) { array list < snapshot shard failure > shard failure array list = new array list < > ( ) ; while ( parser next token ( ) ! = x content parser token end array ) { shard failure array list add ( snapshot shard failure from x content ( parser ) ) ; } shard failures = collections unmodifiable list ( shard failure array list ) ; } else { / / it was probably created by newer version - ignoring parser skip children ( ) ; } } else if ( token = = x content parser token start object ) { if ( user metadata equals ( current field name ) ) { user metadata = parser map ( ) ; } else { / / it was probably created by newer version - ignoring parser skip children ( ) ; } } } } } if ( uuid = = null ) { / / the old format where there wasn ' t a uuid uuid = name ; } return new snapshot info ( new snapshot id ( name , uuid ) , indices , data streams , state , reason , version , start time , end time , total shards , successful shards , shard failures , include global state , user metadata ) ; }


the version of the match or { @ code - 1 } if the version wasn ' t requested the { @ code - 1 } keeps it inline with elasticsearch ' s internal a p is


add a new entry with the specified key , value and hash code to the specified bucket it is the responsibility of this method to resize the table if appropriate subclass overrides this to alter the behavior of put method

void add entry ( int hash , long key , value value , int bucket index ) { table [ bucket index ] = new long entry < > ( hash , key , value , table [ bucket index ] ) ; if ( size + + > = threshold ) resize ( 2 * table length ) ; }


handles the cluster state transition to a version that reflects the provided { @ link alias action } s

public cluster state apply alias actions ( cluster state current state , iterable < alias action > actions ) { list < index > indices to close = new array list < > ( ) ; map < string , index service > indices = new hash map < > ( ) ; try { boolean changed = false ; / / gather all the indexes that must be removed first so : / / 1 we don ' t cause error when attempting to replace an index with a alias of the same name / / 2 we don ' t allow removal of aliases from indexes that we ' re just going to delete anyway that ' d be silly set < index > indices to delete = new hash set < > ( ) ; for ( alias action action : actions ) { if ( action remove index ( ) ) { index metadata index = current state metadata ( ) get indices ( ) get ( action get index ( ) ) ; if ( index = = null ) { throw new index not found exception ( action get index ( ) ) ; } validate alias target is not d s backing index ( current state , action ) ; indices to delete add ( index get index ( ) ) ; changed = true ; } } / / remove the indexes if there are any to remove if ( changed ) { current state = delete index service delete indices ( current state , indices to delete ) ; } metadata builder metadata = metadata builder ( current state metadata ( ) ) ; / / run the remaining alias actions final set < string > maybe modified indices = new hash set < > ( ) ; for ( alias action action : actions ) { if ( action remove index ( ) ) { / / handled above continue ; } index metadata index = metadata get ( action get index ( ) ) ; if ( index = = null ) { throw new index not found exception ( action get index ( ) ) ; } validate alias target is not d s backing index ( current state , action ) ; new alias validator new alias validator = ( alias , index routing , filter , write index ) - > { / * it is important that we look up the index using the metadata builder we are modifying so we can remove an * index and replace it with an alias * / function < string , index metadata > index lookup = name - > metadata get ( name ) ; alias validator validate alias ( alias , action get index ( ) , index routing , index lookup ) ; if ( strings has length ( filter ) ) { index service index service = indices get ( index get index ( ) get name ( ) ) ; if ( index service = = null ) { index service = indices service index service ( index get index ( ) ) ; if ( index service = = null ) { / / temporarily create the index and add mappings so we can parse the filter try { index service = indices service create index ( index , empty list ( ) , false ) ; indices to close add ( index get index ( ) ) ; } catch ( i o exception e ) { throw new elasticsearch exception ( " failed to create temporary index for parsing the alias " , e ) ; } index service mapper service ( ) merge ( index , mapper service merge reason mapping recovery ) ; } indices put ( action get index ( ) , index service ) ; } / / the context is only used for validation so it ' s fine to pass fake values for the shard id , / / but the current timestamp should be set to real value as we may use ` now ` in a filtered alias alias validator validate alias filter ( alias , filter , index service new query shard context ( 0 , 0 , null , ( ) - > system current time millis ( ) , null , empty map ( ) ) , x content registry ) ; } } ; if ( action apply ( new alias validator , metadata , index ) ) { changed = true ; maybe modified indices add ( index get index ( ) get name ( ) ) ; } } for ( final string maybe modified index : maybe modified indices ) { final index metadata current index metadata = current state metadata ( ) index ( maybe modified index ) ; final index metadata new index metadata = metadata get ( maybe modified index ) ; / / only increment the aliases version if the aliases actually changed for this index if ( current index metadata get aliases ( ) equals ( new index metadata get aliases ( ) ) = = false ) { assert current index metadata get aliases version ( ) = = new index metadata get aliases version ( ) ; metadata put ( new index metadata builder ( new index metadata ) aliases version ( 1 + current index metadata get aliases version ( ) ) ) ; } } if ( changed ) { cluster state updated state = cluster state builder ( current state ) metadata ( metadata ) build ( ) ; / / even though changes happened , they resulted in 0 actual changes to metadata / / i e remove and add the same alias to the same index if ( ! updated state metadata ( ) equals aliases ( current state metadata ( ) ) ) { return updated state ; } } return current state ; } finally { for ( index index : indices to close ) { indices service remove index ( index , no longer assigned , " created for alias processing " ) ; } } }


creates a new { @ link client stream tracer factory } with provided { @ link orca per request report listener } installed to receive callback when a per - request orca report is received example usages : delegating policy ( e g , x d s ) { @ code class xds picker extends subchannel picker { public pick result pick subchannel ( pick subchannel args args ) { subchannel picker per locality picker = locality picking logic result result = per locality picker pick subchannel ( args ) ; return pick result with subchannel ( result get subchannel ( ) , orca per request report util get instance ( ) new orca client tracer factory ( result get stream tracer factory ( ) , listener ) ) ; } } } delegating policy with additional tracing logic { @ code class wrapping picker extends subchannel picker { public pick result pick subchannel ( pick subchannel args args ) { result result = delegate pick subchannel ( args ) ; return pick result with subchannel ( result get subchannel ( ) , new client stream tracer factory ( ) { public client stream tracer new client stream tracer ( stream info info , metadata metadata ) { client stream tracer factory orca tracer factory = orca per request report util get instance ( ) new orca client stream tracer factory ( result get stream tracer factory ( ) , listener ) ; wrap the tracer from the delegate factory if you need to trace the stream for your own final client stream tracer orca tracer = orca tracer factory new client stream tracer ( info , metadata ) ; return forwarding client stream tracer ( ) { protected client stream tracer delegate ( ) { return orca tracer ; } public void inbound message ( int seq no ) { handle this event } } ; } } ) ; } } }

public abstract client stream tracer factory new orca client stream tracer factory ( client stream tracer factory delegate , orca per request report listener listener ) ;


returns the class object representing the class or interface that declares the method

public class get declaring class ( ) { return method get declaring class ( ) ; }


read and return the next value in the file

public synchronized writable next ( writable value ) throws i o exception { return next ( key , value ) ? value : null ; }


public void test bind multiple ( ) throws exception { default channel group channel group = new default channel group ( global event executor instance ) ; nio event loop group group = new nio event loop group ( ) ; try { for ( int i = 0 ; i < 100 ; i + + ) { bootstrap udp bootstrap = new bootstrap ( ) ; udp bootstrap group ( group ) channel ( nio datagram channel class ) option ( channel option so broadcast , true ) handler ( new channel inbound handler adapter ( ) { @ override public void channel read ( channel handler context ctx , object msg ) { / / discard reference count util release ( msg ) ; } } ) ; datagram channel datagram channel = ( datagram channel ) udp bootstrap bind ( new inet socket address ( 0 ) ) sync uninterruptibly ( ) channel ( ) ; channel group add ( datagram channel ) ; } assert assert equals ( 100 , channel group size ( ) ) ; } finally { channel group close ( ) sync ( ) ; group shutdown gracefully ( ) sync ( ) ; } }


gets the location of the log file for a job if no task attempt id is specified , otherwise gets the log location for the task attempt id

public log params get log file params ( job i d job i d , task attempt i d task attempt i d ) throws i o exception , interrupted exception ;


public boolean load ( ) { boolean result = this mapped file queue load ( ) ; log info ( " load consume queue extend " + this topic + " - " + this queue id + " " + ( result ? " ok " : " failed " ) ) ; return result ; }


indicates whether this buffer is based on a byte array and provides readwrite access

public final boolean has array ( ) { return protected has array ( ) ; }


convenience method to call { @ link script # parse ( x content parser , string ) } using the default scripting language

public static script parse ( x content parser parser ) throws i o exception { return parse ( parser , default script lang ) ; }


calculates the average over all seen values

public long get average ( ) { if ( count = = 0 ) { return 0 ; } else { return sum / count ; } }


returns an array of all files in the given directory matching

public static path [ ] files ( path from , directory stream filter < path > filter ) throws i o exception { try ( directory stream < path > stream = files new directory stream ( from , filter ) ) { return to array ( stream ) ; } }


returns the topic that the presented element should be sent to this is not used for setting the topic ( this is done via the { @ link org apache kafka clients producer producer record } that is returned from { @ link kafka serialization schema # serialize ( object , long ) } , it is only used for getting the available partitions that are presented to { @ link # set partitions ( int [ ] ) }


drop a temporary table in a given fully qualified path

public void drop temporary table ( object identifier object identifier , boolean ignore if not exists ) { drop temporary table internal ( object identifier , ( table ) - > table instanceof catalog table , ignore if not exists ) ; }


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


expose the synchronous spring rest template to allow synchronous invocation

rest operations get rest operations ( ) ; / / get


returns a handle to the child with the specified name @ throw gdx runtime exception if this file handle is a { @ link file type # classpath } or { @ link file type # internal } and the child doesn ' t exist

public file handle child ( string name ) { return new gwt file handle ( preloader , ( file is empty ( ) ? " " : ( file + ( file ends with ( " / " ) ? " " : " / " ) ) ) + name , file type internal ) ; }


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


public synchronized datum load ( string key ) throws exception { long start = system current time millis ( ) ; / / load data for ( file cache : list caches ( ) ) { if ( ! cache is file ( ) ) { loggers raft warn ( " warning : encountered directory in cache dir : { } " , cache get absolute path ( ) ) ; } if ( ! string utils equals ( cache get name ( ) , encode datum key ( key ) ) ) { continue ; } loggers raft info ( " finish loading datum , key : { } cost { } ms " , key , ( system current time millis ( ) - start ) ) ; return read datum ( cache , string utils empty ) ; } return null ; }


removes the item from the disk cache and the staging area

public task < void > remove ( final cache key key ) { preconditions check not null ( key ) ; m staging area remove ( key ) ; try { final object token = fresco instrumenter on before submit work ( " buffered disk cache remove " ) ; return task call ( new callable < void > ( ) { @ override public void call ( ) throws exception { final object current token = fresco instrumenter on begin work ( token , null ) ; try { m staging area remove ( key ) ; m file cache remove ( key ) ; } catch ( throwable th ) { fresco instrumenter mark failure ( token , th ) ; throw th ; } finally { fresco instrumenter on end work ( current token ) ; } return null ; } } , m write executor ) ; } catch ( exception exception ) { / / log failure / / todo : 3697790 f log w ( tag , exception , " failed to schedule disk - cache remove for % s " , key get uri string ( ) ) ; return task for error ( exception ) ; } }


sets the checkpoint trigger through which the source can trigger the checkpoint


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


enables an index block for the specified index

public static void enable index block ( string index , string block ) { if ( index metadata a p i block from setting ( block ) = = index metadata a p i block read only allow delete | | random boolean ( ) ) { / / the read - only - allow - delete block isn ' t supported by the add block api so we must use the update settings api here settings settings = settings builder ( ) put ( block , true ) build ( ) ; client ( ) admin ( ) indices ( ) prepare update settings ( index ) set settings ( settings ) get ( ) ; } else { client ( ) admin ( ) indices ( ) prepare add block ( index metadata a p i block from setting ( block ) , index ) get ( ) ; } }


default health check metrics create health checker gauge ( string name , metrics tag keys tag keys , metrics tag values tag values ) { preconditions check argument ( ! strings is null or empty ( name ) , " require non - null or empty metric name " ) ; return new health check metrics ( create gauge ( strings lenient format ( " % s % s " , health metric prefix , name ) , strings lenient format ( " % s health check " , name ) , tag keys , tag values ) ) ; }


gets the list of { @ link build } s that include changes by this user , by the timestamp order

public @ non null run list get builds ( ) { return run list from jobs ( ( iterable ) jenkins get ( ) all items ( job class ) ) filter ( ( predicate < run < ? , ? > > ) r - > r instanceof abstract build & & related to ( ( abstract build < ? , ? > ) r ) ) ; }


public get index response get ( get index request get index request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( get index request , indices request converters : : get index , options , get index response : : from x content , empty set ( ) ) ; }


determines whether a character is an iso control character as specified by { @ link character # is i s o control ( char ) } all iso control codes are on the bmp and thus supported by this api

public static char matcher java iso control ( ) { return java iso control instance ; }


returns a hash code value for the object this method is supported for the benefit of hashtables such as those provided by < code > java util hashtable < code >

public int hash code ( ) { return producer tool get name ( ) hash code ( ) + consumer tool get name ( ) hash code ( ) ; }


public int get table size ( ) { return get row size ( ) * get num rows ( ) ; }


add a file to job config for shared cache processing if shared cache is enabled , it will return true , otherwise , return false we don ' t check with scm here given application might not be able to provide the job id ; client s c m protocol use requires the application id job submitter will read the files from job config and take care of things

public static boolean add file to shared cache ( uri resource , configuration conf ) { shared cache config sc config = new shared cache config ( ) ; sc config init ( conf ) ; if ( sc config is shared cache files enabled ( ) ) { string files = conf get ( m r job config files for shared cache ) ; conf set ( m r job config files for shared cache , files = = null ? resource to string ( ) : files + " , " + resource to string ( ) ) ; return true ; } else { return false ; } }


creates a { @ code tree based table } with the same mappings and sort order as the specified { @ code tree based table }

public static < r , c , v > tree based table < r , c , v > create ( tree based table < r , c , ? extends v > table ) { tree based table < r , c , v > result = new tree based table < > ( table row comparator ( ) , table column comparator ( ) ) ; result put all ( table ) ; return result ; }


insert the specified number of records using random keys

private d b record [ ] create random fixed key table records ( table table , int record cnt , int var data size ) throws i o exception { long tx id = dbh start transaction ( ) ; if ( table = = null ) { table = d b test utils create fixed key table ( dbh , table 1 name , d b test utils all types , false , false ) ; } d b record [ ] recs = new d b record [ record cnt ] ; for ( int i = 0 ; i < record cnt ; i + + ) { try { recs [ i ] = d b test utils create fixed key record ( table , var data size , true ) ; } catch ( duplicate key exception e ) { assert fail ( " duplicate key error " ) ; } } dbh end transaction ( tx id , true ) ; return recs ; }


creates a new data stream that contains a sequence of numbers this is a parallel source , if you manually set the parallelism to { @ code 1 } ( using { @ link org apache flink streaming api datastream single output stream operator # set parallelism ( int ) } ) the generated sequence of elements is in order

public data stream source < long > generate sequence ( long from , long to ) { if ( from > to ) { throw new illegal argument exception ( " start of sequence must not be greater than the end " ) ; } return add source ( new stateful sequence source ( from , to ) , " sequence source ( deprecated ) " ) ; }


inet socket address get zookeeper address ( ) ;


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

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


public static < t > t get ( @ non null final string key , final t default value , @ non null final cache memory utils cache memory utils ) { return cache memory utils get ( key , default value ) ; }


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


add a filter for specific url patterns this is delegated to { @ link configurable mock mvc builder # add filter ( filter , string ) }

< t extends b > t filter ( filter filter , string url patterns ) ;


tests the failure response with { @ link unknown kv state id exception } as cause on queries for unregistered kv state i ds

public void test query unknown kv state i d ( ) throws exception { kv state registry registry = new kv state registry ( ) ; atomic kv state request stats stats = new atomic kv state request stats ( ) ; message serializer < kv state internal request , kv state response > serializer = new message serializer < > ( new kv state internal request kv state internal request deserializer ( ) , new kv state response kv state response deserializer ( ) ) ; kv state server handler handler = new kv state server handler ( test server , registry , serializer , stats ) ; embedded channel channel = new embedded channel ( get frame decoder ( ) , handler ) ; long request id = integer max value + 182828l ; kv state internal request request = new kv state internal request ( new kv state i d ( ) , new byte [ 0 ] ) ; byte buf ser request = message serializer serialize request ( channel alloc ( ) , request id , request ) ; / / write the request and wait for the response channel write inbound ( ser request ) ; byte buf buf = ( byte buf ) read inbound blocking ( channel ) ; buf skip bytes ( 4 ) ; / / skip frame length / / verify the response assert equals ( message type request failure , message serializer deserialize header ( buf ) ) ; request failure response = message serializer deserialize request failure ( buf ) ; buf release ( ) ; assert equals ( request id , response get request id ( ) ) ; assert true ( " did not respond with expected failure cause " , response get cause ( ) instanceof unknown kv state id exception ) ; assert equals ( 1l , stats get num requests ( ) ) ; assert equals ( 1l , stats get num failed ( ) ) ; }


returns true if this property type is applicable to the given target type the default implementation of this method checks if the given node type is assignable according to the parameterization , but subtypes can extend this to change this behavior

public boolean is applicable ( class < ? extends t > target type ) { class < ? extends t > applicable = functions get type parameter ( clazz , get p ( ) , 0 ) ; return applicable is assignable from ( target type ) ; }


check whether the given object is a jdk dynamic proxy this method goes beyond the implementation of { @ link proxy # is proxy class ( class ) } by additionally checking if the given object is an instance of { @ link spring proxy }

public static boolean is jdk dynamic proxy ( @ nullable object object ) { return ( object instanceof spring proxy & & proxy is proxy class ( object get class ( ) ) ) ; }


returns the existing { @ link s s l context holder } for the configuration

s s l context holder ssl context holder ( s s l configuration ssl configuration ) { s s l context holder holder = ssl contexts get ( ssl configuration ) ; if ( holder = = null ) { / / normally we ' d throw here but let ' s create a new one that is not cached and will not be monitored for changes ! holder = create ssl context ( ssl configuration ) ; } return holder ; }


returns the latitude value from the string based geohash

public static final double decode longitude ( final string geohash ) { return decode longitude ( geohash morton encode ( geohash ) ) ; }


public void debug print ( print writer out , boolean verbose ) { / / todo : maybe put something better here ? out println ( to string ( ) ) ; }


handles the creation of the s s l service along with the necessary actions to enable reloading of s s l contexts when configuration files change on disk

private s s l service create s s l service ( environment environment , resource watcher service resource watcher service ) { final map < string , s s l configuration > ssl configurations = s s l service get s s l configurations ( environment settings ( ) ) ; final s s l configuration reloader reloader = new s s l configuration reloader ( environment , resource watcher service , ssl configurations values ( ) ) ; final s s l service ssl service = new s s l service ( environment , ssl configurations ) ; reloader set s s l service ( ssl service ) ; set ssl service ( ssl service ) ; return ssl service ; }


returns a new factory that with default to { @ code fallback json adapter from json ( reader ) } upon decoding of unrecognized labels the { @ link json reader } instance will not be automatically consumed , so sure to consume it within your implementation of { @ link json adapter # from json ( json reader ) }

public polymorphic json adapter factory < t > with fallback json adapter ( @ nullable json adapter < object > fallback json adapter ) { return new polymorphic json adapter factory < > ( base type , label key , labels , subtypes , fallback json adapter ) ; }


turns iterable of { a b c } into string " [ ' a ' , ' b ' , ' c ' ] " , appends to supplied string builder

private void print list ( string builder sb , collection < string > elements ) { sb append ( " [ " ) ; joiner on ( " , " ) append to ( sb , iterables transform ( elements , new function < string , string > ( ) { @ override public string apply ( string from ) { return " ' " + from + " ' " ; } } ) ) ; sb append ( " ] " ) ; }


obtain a { @ link jackson 2 object mapper builder } instance in order to build a regular json { @ link object mapper } instance

public static jackson 2 object mapper builder json ( ) { return new jackson 2 object mapper builder ( ) ; }


add cli options which are specific to the transition to active command and no others

private void add transition to active cli opts ( options transition to active cli opts ) { transition to active cli opts add option ( forceactive , false , " force active " ) ; }


a server method implemented using { @ link retry cache }

int echo ( int input , int failure output , long method time , boolean success ) throws interrupted exception { cache entry with payload entry = retry cache wait for completion ( retry cache , null ) ; if ( entry ! = null & & entry is success ( ) ) { system out println ( " retry count incremented " + retry count get ( ) ) ; retry count increment and get ( ) ; return ( integer ) entry get payload ( ) ; } try { operation count increment and get ( ) ; if ( method time > 0 ) { thread sleep ( method time ) ; } } finally { retry cache set state ( entry , success , input ) ; } return success ? input : failure output ; }


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

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


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


the full matrix for the { @ link # get main image ( ) } from { @ link # root } down

matrix get main image full matrix ( ) { matrix matrix = new matrix ( ) ; matrix pre concat ( view get local matrix ( ) ) ; matrix pre concat ( get main image full matrix from flip rotate ( ) ) ; return matrix ; }


append an input count to the progress message , e g " 2 source jars " if an input count has already been appended , prefix with " , "

private static boolean append count ( string builder sb , boolean first , int count , string name ) { if ( count > 0 ) { if ( ! first ) { sb append ( " , " ) ; } else { first = false ; } sb append ( count ) append ( ' ' ) append ( name ) ; if ( count > 1 ) { sb append ( ' s ' ) ; } } return first ; }


tests registration with the kv state registry

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


sets whether audio should be played using the offload path audio offload disables exo player audio processing , but significantly reduces the energy consumption of the playback when { @ link exo player # experimental set offload scheduling enabled ( boolean ) offload scheduling } is enabled most android devices can only support one offload { @ link android media audio track } at a time and can invalidate it at any time thus an app can never be guaranteed that it will be able to play in offload the default value is { @ code false }

public default renderers factory set enable audio offload ( boolean enable offload ) { this enable offload = enable offload ; return this ; }


returns true if the given point is inside the triangle

public static boolean is point in triangle ( float px , float py , float ax , float ay , float bx , float by , float cx , float cy ) { float px 1 = px - ax ; float py 1 = py - ay ; boolean side 1 2 = ( bx - ax ) * py 1 - ( by - ay ) * px 1 > 0 ; if ( ( cx - ax ) * py 1 - ( cy - ay ) * px 1 > 0 = = side 1 2 ) return false ; if ( ( cx - bx ) * ( py - by ) - ( cy - by ) * ( px - bx ) > 0 ! = side 1 2 ) return false ; return true ; }


returns the max content length that the rest client endpoint could handle

public int get max content length ( ) { return max content length ; }


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


public int get percentile ( double percentile ) { if ( length = = 0 ) { return 0 ; } return compute percentile ( percentile ) ; }


if a password for the provider is needed , but is not provided , this will return a warning and instructions for supplying said password to the provider

public string no password warning ( ) { return null ; }


create a statement if { @ code is directory } is true , a " " is added to the path this is critical when adding wildcard permissions under a directory , and also needed when locking down dir - as - file and dir - as - directory - marker access

public static statement statement ( final boolean allow , final path path , final boolean is directory , final boolean wildcards , final string actions ) { return new statement ( role model effect ( allow ) ) add actions ( actions ) add resources ( resource ( path , is directory , wildcards ) ) ; }


require an operation to fail with a file not found exception

protected < t > file not found exception file not found ( final callable < t > eval ) throws exception { return intercept ( file not found exception class , eval ) ; }


resets the contents of sorted multiset to have entries a , c , for the navigation tests

private void reset with hole ( ) { list < e > container = new array list < e > ( ) ; container add all ( collections n copies ( a get count ( ) , a get element ( ) ) ) ; container add all ( collections n copies ( c get count ( ) , c get element ( ) ) ) ; super reset container ( get subject generator ( ) create ( container to array ( ) ) ) ; sorted multiset = ( sorted multiset < e > ) get multiset ( ) ; }


guaranteed to throw an exception and leave the map unmodified

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


{ @ inherit doc } the default implementation returns the result of calling { @ link # visit children } on { @ code ctx }

@ override public t visit join criteria ( sql base parser join criteria context ctx ) { return visit children ( ctx ) ; }


sets the < code > capital camel < code > property

public void set capital camel ( string capital camel ) { this capital camel = capital camel ; }


creates an { @ link runtime exception } that signals that an operation did not get the type of { @ link state object } that was expected this can mostly happen when a different { @ link state backend } from the one that was used for taking a checkpointsavepoint is used when restoring

public static runtime exception unexpected state handle exception ( class < ? extends state object > expected state handle class , class < ? extends state object > actual state handle class ) { return unexpected state handle exception ( new class [ ] { expected state handle class } , actual state handle class ) ; }


finds or creates the new package prefix for the given package

private string new package prefix ( string package prefix ) { / / doesn ' t the package prefix have a new package prefix yet ? string new package prefix = ( string ) package prefix map get ( package prefix ) ; if ( new package prefix = = null ) { / / are we keeping the package name ? if ( keep package names matcher ! = null & & keep package names matcher matches ( package prefix length ( ) > 0 ? package prefix substring ( 0 , package prefix length ( ) - 1 ) : package prefix ) ) { return package prefix ; } / / are we forcing a new package prefix ? if ( repackage classes ! = null ) { return repackage classes ; } / / are we forcing a new superpackage prefix ? / / otherwise figure out the new superpackage prefix , recursively string new super package prefix = flatten package hierarchy ! = null ? flatten package hierarchy : new package prefix ( class util internal package prefix ( package prefix ) ) ; / / come up with a new package prefix new package prefix = generate unique package prefix ( new super package prefix ) ; / / remember to use this mapping in the future package prefix map put ( package prefix , new package prefix ) ; } return new package prefix ; }


{ @ inherit doc } forwards to older method { @ link # matches ( string , string ) }

public boolean matches ( server objs server objs , match values match values ) { return implementation matches ( match values get id ( ) , match values get acl expr ( ) ) ; }


performs a timed { @ code object wait } using this time unit this is a convenience method that converts timeout arguments into the form required by the { @ code object wait } method for example , you could implement a blocking { @ code poll } method ( see { @ link java util concurrent blocking queue # poll blocking queue poll } ) using : public synchronized object poll ( long timeout , time unit unit ) throws interrupted exception { while ( empty ) { unit timed wait ( this , timeout ) ; } }

public void timed wait ( object obj , long timeout ) throws interrupted exception { if ( timeout > 0 ) { long ms = to millis ( timeout ) ; int ns = excess nanos ( timeout , ms ) ; obj wait ( ms , ns ) ; } }


returns an output stream to the file denoted by the current path , creating it and truncating it if necessary the stream is opened for writing

public output stream get output stream ( ) throws i o exception , file not found exception { return get output stream ( false ) ; }


the debug extension array holds extended debugging information which has no semantic effect on the java virtual machine the information is represented using a modified utf - 8 string with no terminating zero byte note that the debug extension array may denote a string longer than that which can be represented with an instance of class string

public byte [ ] get debug extension ( ) { return debug extension ; }


returns the number of writable bytes which is equal to { @ code ( this capacity - this writer index ) }


change the ownership of a path using docker backed privilege escalation

public static void chown with privilege escalation ( path local path , string ownership ) { final path container base path = paths get ( " / mount " ) ; final path container path = container base path resolve ( local path get parent ( ) get file name ( ) ) ; final list < string > args = new array list < > ( ) ; args add ( " cd " + container base path to absolute path ( ) ) ; args add ( " & & " ) ; args add ( " chown - r " + ownership + " " + local path get file name ( ) ) ; final string command = string join ( " " , args ) ; execute privilege escalated shell cmd ( command , local path , container path ) ; }


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


returns a set of index patterns that represent the range provided notably , this compresses months or years using wildcards ( in order to send smaller api calls ) for example , if { @ code begin millis } is 2016 - 11 - 30 and { @ code end millis } is 2017 - 01 - 02 , the result will be 2016 - 11 - 30 , 2016 - 12 - , 2017 - 01 - 01 and 2017 - 01 - 02

public list < string > format type and range ( @ nullable string type , long begin millis , long end millis ) { gregorian calendar current = midnight u t c ( begin millis ) ; gregorian calendar end = midnight u t c ( end millis ) ; string prefix = prefix ( type ) ; list < string > indices = new array list < > ( ) ; while ( current compare to ( end ) < = 0 ) { if ( current get ( calendar month ) = = calendar january & & current get ( day of month ) = = 1 ) { / / attempt to compress a year current set ( calendar day of year , current get actual maximum ( calendar day of year ) ) ; if ( current compare to ( end ) < = 0 ) { indices add ( string format ( " % s - % s % c * " , prefix , current get ( calendar year ) , date separator ( ) ) ) ; current add ( day of month , 1 ) ; / / rollover to next year continue ; } else { current set ( calendar day of year , 1 ) ; / / rollback to first of the year } } else if ( current get ( day of month ) = = 1 ) { / / attempt to compress a month current set ( day of month , current get actual maximum ( day of month ) ) ; if ( current compare to ( end ) < = 0 ) { indices add ( format index pattern ( " % s - % s % c % 0 2d % c * " , current , prefix ) ) ; current add ( day of month , 1 ) ; / / rollover to next month continue ; } current set ( day of month , 9 ) ; / / try to compress days 0 - 9 if ( current compare to ( end ) < = 0 ) { indices add ( format index pattern ( " % s - % s % c % 0 2d % c 0 * " , current , prefix ) ) ; current add ( day of month , 1 ) ; / / rollover to day 10 continue ; } current set ( day of month , 1 ) ; / / set back to day 1 } else if ( current get ( day of month ) = = 10 ) { current set ( day of month , 19 ) ; / / try to compress days 10 - 19 if ( current compare to ( end ) < = 0 ) { indices add ( format index pattern ( " % s - % s % c % 0 2d % c 1 * " , current , prefix ) ) ; current add ( day of month , 1 ) ; / / rollover to day 20 continue ; } current set ( day of month , 10 ) ; / / set back to day 10 } else if ( current get ( day of month ) = = 20 ) { current set ( day of month , 29 ) ; / / try to compress days 20 - 29 if ( current compare to ( end ) < = 0 ) { indices add ( format index pattern ( " % s - % s % c % 0 2d % c 2 * " , current , prefix ) ) ; current add ( day of month , 1 ) ; / / rollover to day 30 continue ; } current set ( day of month , 20 ) ; / / set back to day 20 } indices add ( format type and timestamp ( type , current get time in millis ( ) ) ) ; current add ( day of month , 1 ) ; } return indices ; }


an api rest method to get the allowed { $ link top level item } s and its categories

public categories do item categories ( stapler request req , stapler response rsp , @ query parameter string icon style ) throws i o exception , servlet exception { get owner ( ) check permission ( item create ) ; rsp add header ( " cache - control " , " no - cache , no - store , must - revalidate " ) ; rsp add header ( " pragma " , " no - cache " ) ; rsp add header ( " expires " , " 0 " ) ; categories categories = new categories ( ) ; int order = 0 ; jelly context ctx ; if ( string utils is not blank ( icon style ) ) { ctx = new jelly context ( ) ; ctx set variable ( " res u r l " , req get context path ( ) + jenkins resource path ) ; } else { ctx = null ; } for ( top level item descriptor descriptor : descriptor visibility filter apply ( get owner ( ) get item group ( ) , items all 2 ( jenkins get authentication 2 ( ) , get owner ( ) get item group ( ) ) ) ) { item category ic = item category get category ( descriptor ) ; map < string , serializable > metadata = new hash map < > ( ) ; / / information about item metadata put ( " class " , descriptor get id ( ) ) ; metadata put ( " order " , + + order ) ; metadata put ( " display name " , descriptor get display name ( ) ) ; metadata put ( " description " , descriptor get description ( ) ) ; metadata put ( " icon file path pattern " , descriptor get icon file path pattern ( ) ) ; string icon class name = descriptor get icon class name ( ) ; if ( string utils is not blank ( icon class name ) ) { metadata put ( " icon class name " , icon class name ) ; if ( ctx ! = null ) { icon icon = icon set icons get icon by class spec ( string utils join ( new string [ ] { icon class name , icon style } , " " ) ) ; if ( icon ! = null ) { metadata put ( " icon qualified url " , icon get qualified url ( ctx ) ) ; } } } category category = categories get item ( ic get id ( ) ) ; if ( category ! = null ) { category get items ( ) add ( metadata ) ; } else { list < map < string , serializable > > temp = new array list < > ( ) ; temp add ( metadata ) ; category = new category ( ic get id ( ) , ic get display name ( ) , ic get description ( ) , ic get order ( ) , ic get min to show ( ) , temp ) ; categories get items ( ) add ( category ) ; } } return categories ; }


if { @ code is dirty ( ) } , then either returns the new value for the value or { @ code null } if the new value wasn ' t computed in the case where the value is dirty and a new value is available , then the new value can be injected into the skyframe graph otherwise , the value should simply be invalidated

sky value get new value ( ) { preconditions check state ( is dirty ( ) , new value ) ; return new value ; }


returns the lowest positive root of the quadric equation given by a x x + b x + c = 0 if no solution is given float nan is returned

static public float lowest positive root ( float a , float b , float c ) { float det = b * b - 4 * a * c ; if ( det < 0 ) return float na n ; float sqrt d = ( float ) math sqrt ( det ) ; float inv a = 1 / ( 2 * a ) ; float r 1 = ( - b - sqrt d ) * inv a ; float r 2 = ( - b + sqrt d ) * inv a ; if ( r 1 > r 2 ) { float tmp = r 2 ; r 2 = r 1 ; r 1 = tmp ; } if ( r 1 > 0 ) return r 1 ; if ( r 2 > 0 ) return r 2 ; return float na n ; }


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


writes the entire character buffer { @ code buf } to the target

public void write ( char buf [ ] ) throws i o exception { write ( buf , 0 , buf length ) ; }


returns a { @ code comparator < boolean > } that sorts { @ code false } before { @ code true } this is particularly useful in java 8 + in combination with { @ code comparators comparing } , e g { @ code comparators comparing ( foo : : has bar , false first ( ) ) }

public static comparator < boolean > false first ( ) { return boolean comparator false first ; }


returns overloaded name ( with parameters )


whether to match to u r ls irrespective of the presence of a trailing slash if enabled a method mapped to " users " also matches to " users " the default value is { @ code true }

public path match configurer set use trailing slash match ( boolean trailing slash match ) { this trailing slash match = trailing slash match ; return this ; }


provides an override location , if any is specified , for the openapi - generator - ignore this is originally intended for the first generation only

public string get ignore file path override ( ) { return ignore file path override ; }


initialize the given application context

void initialize ( c application context ) ;


returns parameter names referenced by sql providers

public string [ ] get names ( ) { return names values ( ) to array ( new string [ 0 ] ) ; }


update an existing pet ( asynchronously )

public okhttp 3 call update pet async ( pet body , final api callback < void > callback ) throws api exception { okhttp 3 call local var call = update pet validate before call ( body , callback ) ; local var api client execute async ( local var call , callback ) ; return local var call ; }


awaits until this { @ code test observer } { @ code test subscriber } receives an { @ code on error } or { @ code on complete } events

public final u await ( ) throws interrupted exception { if ( done get count ( ) = = 0 ) { return ( u ) this ; } done await ( ) ; return ( u ) this ; }


returns whether the instruction at the given offset has been modified in any way

public boolean is modified ( int instruction offset ) { return pre insertions [ instruction offset ] ! = null | | replacements [ instruction offset ] ! = null | | post insertions [ instruction offset ] ! = null | | deleted [ instruction offset ] ; }


puts an array of bytes into this byte vector the byte vector is automatically enlarged if necessary

public byte vector put byte array ( final byte [ ] byte array value , final int byte offset , final int byte length ) { if ( length + byte length > data length ) { enlarge ( byte length ) ; } if ( byte array value ! = null ) { system arraycopy ( byte array value , byte offset , data , length , byte length ) ; } length + = byte length ; return this ; }


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


public query result select ( final string query , final optional < json object > parameters ) { val formatted query = string format ( " select * from ` % s ` where % s " , properties get bucket ( ) , query ) ; val options = query options query options ( ) scan consistency ( query scan consistency value of ( properties get scan consistency ( ) ) ) ; parameters if present ( options : : parameters ) ; return execute query ( options , formatted query ) ; }


schedule the given { @ link runnable } , invoking it at the specified execution time and subsequently with the given delay between the completion of one execution and the start of the next execution will end once the scheduler shuts down or the returned { @ link scheduled future } gets cancelled

default scheduled future < ? > schedule with fixed delay ( runnable task , instant start time , duration delay ) { return schedule with fixed delay ( task , date from ( start time ) , delay to millis ( ) ) ; }


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


process the recorded replicas when about to commit or finish the pipeline recovery sort out bad replicas

public list < replica under construction > set generation stamp and verify replicas ( long gen stamp ) { preconditions check state ( uc ! = null & & ! is complete ( ) ) ; / / set the generation stamp for the block set generation stamp ( gen stamp ) ; return uc get stale replicas ( gen stamp ) ; }


resolve the given interface mappings , turning class names into class objects

private map < string , class < ? > [ ] > resolve interface mappings ( properties mappings ) { map < string , class < ? > [ ] > resolved mappings = collection utils new hash map ( mappings size ( ) ) ; for ( enumeration < ? > en = mappings property names ( ) ; en has more elements ( ) ; ) { string bean key = ( string ) en next element ( ) ; string [ ] class names = string utils comma delimited list to string array ( mappings get property ( bean key ) ) ; class < ? > [ ] classes = resolve class names ( class names , bean key ) ; resolved mappings put ( bean key , classes ) ; } return resolved mappings ; }


create the { @ code bootstrap context } for the specified { @ linkplain class test class } uses reflection to create a { @ link org springframework test context support default bootstrap context } that uses a { @ link org springframework test context cache default cache aware context loader delegate }

static bootstrap context create bootstrap context ( class < ? > test class ) { cache aware context loader delegate cache aware context loader delegate = create cache aware context loader delegate ( ) ; class < ? extends bootstrap context > clazz = null ; try { clazz = ( class < ? extends bootstrap context > ) class utils for name ( default bootstrap context class name , bootstrap utils class get class loader ( ) ) ; constructor < ? extends bootstrap context > constructor = clazz get constructor ( class class , cache aware context loader delegate class ) ; if ( logger is debug enabled ( ) ) { logger debug ( string format ( " instantiating bootstrap context using constructor [ % s ] " , constructor ) ) ; } return bean utils instantiate class ( constructor , test class , cache aware context loader delegate ) ; } catch ( throwable ex ) { throw new illegal state exception ( " could not load bootstrap context [ " + clazz + " ] " , ex ) ; } }


sets a job to run after all currently running and queued jobs if a final job was already set , then that job will be replaced with the given job

public synchronized void set final job ( graph job job ) { trace ( " set final job ( ) - " + job ) ; if ( job is finished ( ) ) { throw new illegal argument exception ( " cannot schedule a finished job ! " ) ; } / / simply overwrite any pending final job , as we can only have one final job = objects require non null ( job , " graph job cannot be null " ) ; swing ( this : : maybe run next job ) ; }


public static node status get node status ( memory segment memory segment , int offset ) { byte status = ( byte ) ( ( memory segment get int ( offset + key meta offset ) > > > 8 ) & byte mask ) ; return node status value of ( status ) ; }


get storeinventory : returns pet inventories by status returns a map of status codes to quantities

public response entity < map < string , integer > > get inventory ( ) { return delegate get inventory ( ) ; }


get all of the headers and values associated with the headers modifications of this map are not supported

public final map < string , list < string > > get headers ( ) { return headers ; }


public void execute ( file system fs ) throws i o exception { if ( fs instanceof distributed file system ) { distributed file system dfs = ( distributed file system ) fs ; dfs access ( path , mode ) ; http f s server web app get ( ) get metrics ( ) incr ops check access ( ) ; } else { throw new unsupported operation exception ( " checkaccess is " + " not supported for http fs on " + fs get class ( ) + " please check your fs default f s configuration " ) ; } return null ; }


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


sasl extensions that were not recognized ( neither validated nor invalidated ) by the callback handler must not be accessible through the { @ code # get negotiated property ( ) } method

public void unrecognized extensions are not saved ( ) throws exception { sasl server = new o auth bearer sasl server ( extensions validator callback handler ) ; map < string , string > custom extensions = new hash map < > ( ) ; custom extensions put ( " first key " , " value 1 " ) ; custom extensions put ( " second key " , " value 1 " ) ; custom extensions put ( " third key " , " value 1 " ) ; byte [ ] next challenge = sasl server evaluate response ( client initial response ( null , false , custom extensions ) ) ; assert true ( next challenge length = = 0 , " next challenge is not empty " ) ; assert null ( sasl server get negotiated property ( " third key " ) , " extensions not recognized by the server must be ignored " ) ; }


calculate managed memory fraction for each operator wrapper

private void calculate managed memory fraction ( ) { for ( map entry < transformation < ? > , table operator wrapper < ? > > entry : visited transforms entry set ( ) ) { double fraction = 0 ; if ( managed memory weight ! = 0 ) { fraction = entry get key ( ) get managed memory operator scope use case weights ( ) get or default ( managed memory use case operator , 0 ) * 1 0 / this managed memory weight ; } entry get value ( ) set managed memory fraction ( fraction ) ; } }


deserializes an { @ link abstract ms type } from the { @ link pdb byte reader } and returns it

public abstract ms type parse record ( pdb byte reader reader , record number record number ) throws pdb exception , cancelled exception { abstract ms type result = parse ( reader , abstract ms type class ) ; result set record number ( record number ) ; return result ; }


public static void show message ( string message ) { j option pane show message dialog ( viewer , message ) ; }


public string get flow execution key ( final http servlet request request ) { return request get parameter ( this flow execution key parameter ) ; }


constructs and returns an instance which is identical to this one , except that the signature is changed to the given value

public item with signature ( cst string new signature ) { return new item ( start pc , length , name , descriptor , new signature , index ) ; }