creates { @ link realm factory factories } for each internal realm type this excludes the { @ link reserved realm } , as it cannot be created dynamically

public static map < string , realm factory > get factories ( thread pool thread pool , resource watcher service resource watcher service , s s l service ssl service , native users store native users store , native role mapping store native role mapping store , security index manager security index ) { return map of ( / / file realm file realm settings type , config - > new file realm ( config , resource watcher service , thread pool ) , / / native realm native realm settings type , config - > { final native realm native realm = new native realm ( config , native users store , thread pool ) ; security index add index state listener ( native realm : : on security index state change ) ; return native realm ; } , / / active directory realm ldap realm settings ad type , config - > new ldap realm ( config , ssl service , resource watcher service , native role mapping store , thread pool ) , / / ldap realm ldap realm settings ldap type , config - > new ldap realm ( config , ssl service , resource watcher service , native role mapping store , thread pool ) , / / pki realm pki realm settings type , config - > new pki realm ( config , resource watcher service , native role mapping store ) , / / saml realm saml realm settings type , config - > saml realm create ( config , ssl service , resource watcher service , native role mapping store ) , / / kerberos realm kerberos realm settings type , config - > new kerberos realm ( config , native role mapping store , thread pool ) , / / open i d connect realm open id connect realm settings type , config - > new open id connect realm ( config , ssl service , native role mapping store , resource watcher service ) ) ; }


public mqtt client config get client config ( ) { return client config ; }


returns the default ( first ) host name associated by the default nameserver with the address bound to the specified network interface

public static string get default host ( @ nullable string str interface ) throws unknown host exception { return get default host ( str interface , null , false ) ; }


public surface get surface ( ) { return m surface ; }


public big decimal get number item ( ) { return number item ; }


assert the existence of the given flash attributes

public result matcher attribute exists ( string names ) { return result - > { for ( string name : names ) { assert not null ( " flash attribute ' " + name + " ' does not exist " , result get flash map ( ) get ( name ) ) ; } } ; }


returns a get method matching the property name

public static method get get method ( class < ? > cl , string property name ) { method method = get get method ( cl , property name , false ) ; return method ! = null ? method : get get method ( cl , property name , true ) ; }


returns an iterable view of { @ code x } if it is an iterable starlark value ; throws eval exception otherwise whereas the interpreter temporarily freezes the iterable value by bracketing { @ code for } loops and comprehensions in calls to { @ link freezable # update iterator count } , iteration using this method does not freeze the value callers should exercise care not to mutate the underlying object during iteration

public static iterable < ? > to iterable ( object x ) throws eval exception { if ( x instanceof starlark iterable ) { return ( iterable < ? > ) x ; } throw errorf ( " type ' % s ' is not iterable " , type ( x ) ) ; }


sets whether the controller is enabled or not

public void set enabled ( boolean enabled ) { m is enabled = enabled ; if ( ! enabled ) { reset ( ) ; } }


return the view class to be used to create views

protected class < ? > get view class ( ) { return this view class ; }


public void write ( data output output ) throws i o exception { text write string ( output , this lower bound clause ) ; text write string ( output , this upper bound clause ) ; }


join records of this stream with another { @ code k stream } ' s records using windowed inner equi join using the { @ link joined } instance for configuration of the { @ link serde key serde } , { @ link serde this stream ' s value serde } , and { @ link serde the other stream ' s value serde } the join is computed on the records ' key with join attribute { @ code this k stream key = = other k stream key } furthermore , two records are only joined if their timestamps are close to each other as defined by the given { @ link join windows } , i e , the window defines an additional join predicate on the record timestamps for each pair of records meeting both join predicates the provided { @ link value joiner } will be called to compute a value ( with arbitrary type ) for the result record the key of the result record is the same as for both joining input records if an input record key or value is { @ code null } the record will not be included in the join operation and thus no output record will be added to the resulting { @ code k stream } example ( assuming all input records belong to the correct windows ) : < table border = ' 1 ' > < tr > < th > this < th > < th > other < th > < th > result < th > < tr > < tr > < td > & lt ; k1 : a & gt ; < td > < td > < td > < td > < td > < tr > < tr > < td > & lt ; k2 : b & gt ; < td > < td > & lt ; k2 : b & gt ; < td > < td > & lt ; k2 : value joiner ( b , b ) & gt ; < td > < tr > < tr > < td > < td > < td > & lt ; k3 : c & gt ; < td > < td > < td > < tr > < table > both input streams ( or to be more precise , their underlying source topics ) need to have the same number of partitions if this is not the case , you would need to call { @ link # repartition ( repartitioned ) } ( for one input stream ) before doing the join and specify the " correct " number of partitions via { @ link repartitioned } parameter furthermore , both input streams need to be co - partitioned on the join key ( i e , use the same partitioner ) if this requirement is not met , kafka streams will automatically repartition the data , i e , it will create an internal repartitioning topic in kafka and write and re - read the data via this topic before the actual join the repartitioning topic will be named " $ { application id } - & lt ; name & gt ; - repartition " , where " application id " is user - specified in { @ link streams config } via parameter { @ link streams config # application id config application id config } , " & lt ; name & gt ; " is an internally generated name , and " - repartition " is a fixed suffix repartitioning can happen for one or both of the joining { @ code k stream } s for this case , all data of the stream will be redistributed through the repartitioning topic by writing all records to it , and rereading all records from it , such that the join input { @ code k stream } is partitioned correctly on its key both of the joining { @ code k stream } s will be materialized in local state stores with auto - generated store names for failure and recovery each store will be backed by an internal changelog topic that will be created in kafka the changelog topic will be named " $ { application id } - & lt ; storename & gt ; - changelog " , where " application id " is user - specified in { @ link streams config } via parameter { @ link streams config # application id config application id config } , " store name " is an internally generated name , and " - changelog " is a fixed suffix you can retrieve all generated internal topic names via { @ link topology # describe ( ) }

< vo , vr > k stream < k , vr > join ( final k stream < k , vo > other stream , final value joiner < ? super v , ? super vo , ? extends vr > joiner , final join windows windows , final joined < k , v , vo > joined ) ;


write to the status file the status file will contain a string describing the exit status of the test it will be success if the test returned success ( return code 0 ) , a numerical code if it returned a non - zero status , or in progress or timed out

private void write status file ( string status ) throws i o exception { file output stream fos = new file output stream ( new file ( results , test name + " pstatus " ) ) ; buffered writer out = null ; try { out = new buffered writer ( new output stream writer ( fos , " utf8 " ) ) ; out write ( status + " \ n " ) ; } finally { if ( out ! = null ) { out close ( ) ; } else { fos close ( ) ; } } }


test nn restart if a failure happens in between creating the fsimage md5 file and renaming the fsimage

public void test failure before rename ( ) throws i o exception { configuration conf = new hdfs configuration ( ) ; f s data output stream fos = null ; secondary name node secondary = null ; mini d f s cluster cluster = null ; file system fs = null ; try { cluster = new mini d f s cluster builder ( conf ) num data nodes ( num datanodes ) build ( ) ; cluster wait active ( ) ; fs = cluster get file system ( ) ; secondary = start secondary name node ( conf ) ; fos = fs create ( new path ( " tmpfile 0 " ) ) ; fos write ( new byte [ ] { 0 , 1 , 2 , 3 } ) ; secondary do checkpoint ( ) ; fos write ( new byte [ ] { 0 , 1 , 2 , 3 } ) ; fos hsync ( ) ; / / cause merge to fail in next checkpoint mockito do throw ( new i o exception ( " injecting failure after m d 5 rename " ) ) when ( fault injector ) after m d 5 rename ( ) ; try { secondary do checkpoint ( ) ; fail ( " fault injection failed " ) ; } catch ( i o exception ioe ) { / / this is expected } mockito reset ( fault injector ) ; / / namenode should still restart successfully cluster restart name node ( ) ; } finally { if ( fs ! = null ) { fs close ( ) ; } cleanup ( secondary ) ; secondary = null ; cleanup ( cluster ) ; cluster = null ; mockito reset ( fault injector ) ; } }


reads the next word of the configuration in the ' next word ' field

private void read next word ( ) throws i o exception { read next word ( false ) ; }


obtain metadata for this bean definition ' s factory method , if any

method metadata get factory method metadata ( ) ;


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


sets the indentation string to be repeated for each level of indentation in the encoded document if { @ code indent is empty ( ) } the encoded document will be compact otherwise the encoded document will be more human - readable

public void set indent ( string indent ) { this indent = ! indent is empty ( ) ? indent : null ; }


closes the ' { @ code button } ' block tag

public int do end tag ( ) throws jsp exception { assert state ( this tag writer ! = null , " no tag writer set " ) ; this tag writer end tag ( ) ; return eval page ; }


allow retaining diffs for unit test and analysis defaults to false ( off )

public void set retain diffs ( boolean b ) { retain diffs = b ; }


public static bitmap screen shot ( @ non null final activity activity , boolean is delete status bar ) { view decor view = activity get window ( ) get decor view ( ) ; bitmap bmp = utils bridge view 2 bitmap ( decor view ) ; display metrics dm = new display metrics ( ) ; activity get window manager ( ) get default display ( ) get metrics ( dm ) ; if ( is delete status bar ) { int status bar height = utils bridge get status bar height ( ) ; return bitmap create bitmap ( bmp , 0 , status bar height , dm width pixels , dm height pixels - status bar height ) ; } else { return bitmap create bitmap ( bmp , 0 , 0 , dm width pixels , dm height pixels ) ; } }


reverses the elements of { @ code array } between { @ code from index } inclusive and { @ code to index } exclusive this is equivalent to { @ code collections reverse ( doubles as list ( array ) sub list ( from index , to index ) ) } , but is likely to be more efficient

public static void reverse ( double [ ] array , int from index , int to index ) { check not null ( array ) ; check position indexes ( from index , to index , array length ) ; for ( int i = from index , j = to index - 1 ; i < j ; i + + , j - - ) { double tmp = array [ i ] ; array [ i ] = array [ j ] ; array [ j ] = tmp ; } }


public void visit throwing cst insn ( throwing cst insn insn ) { / / this space intentionally left blank }


public void set range ( int start , int end ) { if ( end < start | | start < 0 | | end > size ) { throw new illegal argument exception ( ) ; } if ( end = = start ) { return ; } end - - ; / / will be easier to treat this as the last actually set bit - - inclusive int first int = start / 32 ; int last int = end / 32 ; for ( int i = first int ; i < = last int ; i + + ) { int first bit = i > first int ? 0 : start & 0x 1 f ; int last bit = i < last int ? 31 : end & 0x 1 f ; / / ones from first bit to last bit , inclusive int mask = ( 2 < < last bit ) - ( 1 < < first bit ) ; bits [ i ] | = mask ; } }


public static < t > t execute groovy script ( final groovy object groovy object , final string method name , final object [ ] args , final class < t > clazz , final boolean fail on error ) { try { logger trace ( " executing groovy script ' s [ { } ] method , with parameters [ { } ] " , method name , args ) ; val result = groovy object invoke method ( method name , args ) ; logger trace ( " results returned by the groovy script are [ { } ] " , result ) ; if ( ! clazz equals ( void class ) ) { return get groovy script execution result or throw ( clazz , result ) ; } } catch ( final exception e ) { var cause = e instanceof invoker invocation exception ? e get cause ( ) : e ; if ( fail on error ) { throw cause ; } logger error ( cause get message ( ) , cause ) ; } return null ; }


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


return the additional ( undeclared ) property with the specified name

public fruit get additional property ( string key ) { if ( this additional properties = = null ) { return null ; } return this additional properties get ( key ) ; }


create the most appropriate map for the given map type delegates to { @ link # create map ( class , class , int ) } with a { @ code null } key type

public static < k , v > map < k , v > create map ( class < ? > map type , int capacity ) { return create map ( map type , null , capacity ) ; }


reducing the resources ( with a time out ) triggers a preemption message to the am right away then , increasing them again should prevent the killing when the time out would have happened

public void test reduce preempt and cancel ( ) throws exception { container container = create container ( am , 2 * gb ) ; assert memory ( scheduler , nm id , 4 * gb , 0 ) ; / / we give an overcommit time out of 1 seconds final int timeout = ( int ) time unit seconds to millis ( 1 ) ; / / reducing to 2gb should first preempt the container update node resource ( rm , nm id , 2 * gb , 2 , timeout ) ; wait memory ( scheduler , nm , 4 * gb , - 2 * gb , interval , timeout ) ; / / wait until mark container for preemption is handled rm drain events ( ) ; / / we should receive a notification to preempt the container preemption message preempt msg = am schedule ( ) get preemption message ( ) ; assert preemption ( container get id ( ) , preempt msg ) ; / / increase the resources again update node resource ( rm , nm id , 4 * gb , 2 , timeout ) ; wait memory ( scheduler , nm , 4 * gb , 0 , interval , timeout ) ; long t 0 = time now ( ) ; while ( time now ( ) - t 0 < time unit seconds to millis ( 2 ) ) { nm node heartbeat ( true ) ; allocate response allocation = am schedule ( ) ; assert no preemption ( allocation get preemption message ( ) ) ; assert true ( allocation get completed containers statuses ( ) is empty ( ) ) ; thread sleep ( interval ) ; } / / check that the containers are still running assert memory ( scheduler , nm id , 4 * gb , 0 ) ; assert equals ( 2 , scheduler get node report ( nm id ) get num containers ( ) ) ; }


called when an audio renderer is disabled

default void on audio disabled ( event time event time , decoder counters counters ) { }


get the instant recursively when the schemas defined in one ofanyof happen to be one ofany of schema as well

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


display local thumbnail previews , for example exif thumbnails

public t local thumbnail previews enabled ( boolean local thumbnail previews enabled ) { m local thumbnail previews enabled = local thumbnail previews enabled ; return get this ( ) ; }


wrap an { @ link executor } so that it always executes with this context as the { @ link # current } context it is generally expected that { @ link # current context executor ( executor ) } would be used more commonly than this method one scenario in which this executor may be useful is when a single thread is sharding work to multiple threads

public executor fixed context executor ( final executor e ) { final class fixed context executor implements executor { @ override public void execute ( runnable r ) { e execute ( wrap ( r ) ) ; } } return new fixed context executor ( ) ; }


returns the x - position of the knob relative to the center of the widget the positive direction is right

public float get knob x ( ) { return knob position x ; }


return the configured { @ code info receiver } ( never { @ code null } )

public info receiver get info receiver ( ) { return this info receiver ; }


latesttop page where total number of items less than the max page size

public void test latest partial page ( ) throws i o exception { history page filter < model object > history page filter = new page ( 5 , null , null ) ; list < model object > runs = new runs ( 1 , 2 ) ; list < queue item > queue items = new queue items ( 3 , 4 ) ; history page filter add ( runs , queue items ) ; assert assert false ( history page filter has up page ) ; assert assert false ( history page filter has down page ) ; assert assert equals ( 2 , history page filter queue items size ( ) ) ; assert assert equals ( 2 , history page filter runs size ( ) ) ; assert assert equals ( 4 , history page filter queue items get ( 0 ) get entry id ( ) ) ; assert assert equals ( 4 , history page filter newest on page ) ; assert assert equals ( 3 , history page filter queue items get ( 1 ) get entry id ( ) ) ; assert assert equals ( history page entry get entry id ( 2 ) , history page filter runs get ( 0 ) get entry id ( ) ) ; assert assert equals ( history page entry get entry id ( 1 ) , history page filter runs get ( 1 ) get entry id ( ) ) ; assert assert equals ( history page entry get entry id ( 1 ) , history page filter oldest on page ) ; }


the sink node making the request < code > istio mcp v 1alpha 1 sink node sink node = 1 ; < code >

public builder set sink node ( com alibaba nacos istio model mcp sink node value ) { if ( sink node builder = = null ) { if ( value = = null ) { throw new null pointer exception ( ) ; } sink node = value ; on changed ( ) ; } else { sink node builder set message ( value ) ; } return this ; }


get the value of whether there are any non - ec blocks using striped i d

public boolean has non ec block using striped i d ( ) { return has non ec block using striped i d ; }


validates the given process definition against the rules for executing a process definition on the activiti engine to create such a { @ link bpmn model } from a string , following code may be used : x m l input factory xif = x m l input factory new instance ( ) ; input stream reader in = new input stream reader ( new byte array input stream ( my process get bytes ( ) ) , " utf - 8 " ) ; change to other streams for eg from classpath x m l stream reader xtr = xif create x m l stream reader ( in ) ; bpmn model = new bpmn x m l converter ( ) convert to bpmn model ( xtr ) ;

list < validation error > validate process ( bpmn model bpmn model ) ;


processing when receiving the address list

list < url > notify ( list < url > addresses , url consumer url , directory registry directory ) ;


return whether the class with the given name should be loaded in isolation using a plugin classloader

public static boolean should load in isolation ( string name ) { return ! ( exclude matcher ( name ) matches ( ) & & ! include matcher ( name ) matches ( ) ) ; }


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


public enum number enum get enum number ( ) { return enum number ; }


map of string keys and values that can be used by source and sink to communicate arbitrary metadata about this resource < code > map & lt ; string , string & gt ; annotations = 5 ; < code >

java lang string get annotations or throw ( java lang string key ) ;


add a shift ( sn ) entry to the given cell

public boolean put shift ( int from state , assembly terminal next , int new state ) { return put ( from state , next , new shift action ( new state ) ) ; }


public void remove all ( ) { indexer clear ( ) ; }


get the production applied to create this branch

public assembly production get production ( ) { return prod ; }


public string get id as string ( ) { if ( id = = null ) { throw new illegal argument exception ( " id = = null not allowed " ) ; } if ( " " equals ( id ) ) { throw new illegal argument exception ( " empty id not allowed " ) ; } return id ; }


the last character position this span applies to , in utf - 16 offset < code > optional uint 3 2 last char = 3 ; < code >

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


optional < local over window > get over window ( expression alias ) ;


closes all { @ code closeable } instances that have been added to this { @ code closer } if an exception was thrown in the try block and passed to one of the { @ code exception thrown } methods , any exceptions thrown when attempting to close a closeable will be suppressed otherwise , the first exception to be thrown from an attempt to close a closeable will be thrown and any additional exceptions that are thrown after that will be suppressed

public void close ( ) throws i o exception { throwable throwable = thrown ; / / close closeables in lifo order while ( ! stack is empty ( ) ) { closeable closeable = stack remove first ( ) ; try { closeable close ( ) ; } catch ( throwable e ) { if ( throwable = = null ) { throwable = e ; } else { suppressor suppress ( closeable , throwable , e ) ; } } } if ( thrown = = null & & throwable ! = null ) { throwables propagate if possible ( throwable , i o exception class ) ; throw new assertion error ( throwable ) ; / / not possible } }


sets the matrix to an orthographic projection like gl ortho ( http : www opengl orgsdkdocsmanxhtmlgl ortho xml ) following the open g l equivalent

public matrix 4 set to ortho ( float left , float right , float bottom , float top , float near , float far ) { float x orth = 2 / ( right - left ) ; float y orth = 2 / ( top - bottom ) ; float z orth = - 2 / ( far - near ) ; float tx = - ( right + left ) / ( right - left ) ; float ty = - ( top + bottom ) / ( top - bottom ) ; float tz = - ( far + near ) / ( far - near ) ; val [ m00 ] = x orth ; val [ m10 ] = 0 ; val [ m20 ] = 0 ; val [ m30 ] = 0 ; val [ m01 ] = 0 ; val [ m11 ] = y orth ; val [ m21 ] = 0 ; val [ m31 ] = 0 ; val [ m02 ] = 0 ; val [ m12 ] = 0 ; val [ m22 ] = z orth ; val [ m32 ] = 0 ; val [ m03 ] = tx ; val [ m13 ] = ty ; val [ m23 ] = tz ; val [ m33 ] = 1 ; return this ; }


the name of the symbol ( in the form package : typename ) < code > optional string resource name = 1 ; < code >

public com google protobuf byte string get resource name bytes ( ) { return instance get resource name bytes ( ) ; }


close the stream this triggers publishing of the stream statistics back to the filesystem statistics this operation is synchronized , so that only one thread can attempt to close the connection ; all laterblocked calls are no - ops

public synchronized void close ( ) throws i o exception { if ( ! closed ) { closed = true ; try { / / close or abort the stream close stream ( " close ( ) operation " , this content range finish , false ) ; log debug ( " statistics of stream { } \ n { } " , key , stream statistics ) ; / / this is actually a no - op super close ( ) ; } finally { / / merge the statistics back into the fs statistics stream statistics close ( ) ; } } }


test recursive root directory deletion fails if there is an entry underneath

public void test rm root dir recursive is forbidden ( ) throws throwable { path root = path ( " / " ) ; path test file = path ( " / test " ) ; create file ( test file ) ; assert true ( " rm ( / ) returned false " , fs delete ( root , true ) ) ; assert exists ( " root dir is missing " , root ) ; assert path does not exist ( " test file not deleted " , test file ) ; }


public boolean is empty ( ) { return size ( ) = = 0 ; }


sets the class path to be represented in this panel

public void set class path ( class path class path ) { list model clear ( ) ; if ( class path ! = null ) { for ( int index = 0 ; index < class path size ( ) ; index + + ) { list model add element ( class path get ( index ) ) ; } } / / make sure the selection buttons are properly enabled , / / since the clear method doesn ' t seem to notify the listener enable selection buttons ( ) ; }


make sure the acl is exist in the acl map after snap syncing zoo keeper uses acl reference id and count to save the space in snapshot during fuzzy snapshot sync , the reference count may not be updated correctly in case like the znode is already exist when acl reference count reaches 0 , it will be deleted from the cache , but actually there might be other nodes still using it when visiting a node with the deleted acl id , it will be rejected because it doesn ' t exist anymore here is the detailed flow for one of the scenario here : 1 server a starts to have snap sync with leader 2 after serializing the acl map to server a , there is a txn t1 to create a node n1 with new acl 1 which was not exist in acl map 3 on leader , after this txn , the acl map will be id1 - & gt ; ( acl 1 , count : 1 ) , and data tree n1 - & gt ; id1 4 on server a , it will be empty acl map , and n1 - & gt ; id1 in fuzzy snapshot 5 when replaying the txn t1 , it will skip at the beginning since the node is already exist , which leaves an empty acl map , and n1 is referencing to a non - exist acl id1 6 node n1 will be not accessible because the acl not exist , and if it became leader later then all the write requests will be rejected as well with marshalling error

public void test a c l created during fuzzy snapshot sync ( ) throws i o exception { data tree leader data tree = new data tree ( ) ; / / start the simulated snap - sync by serializing acl cache file file = file create temp file ( " snapshot " , " zk " ) ; file output stream os = new file output stream ( file ) ; output archive oa = binary output archive get archive ( os ) ; leader data tree serialize acls ( oa ) ; / / add couple of transaction in - between txn header hdr 1 = new txn header ( 1 , 2 , 2 , 2 , zoo defs op code create ) ; record txn 1 = new create txn ( " / a 1 " , " foo " get bytes ( ) , zoo defs ids creator all acl , false , - 1 ) ; leader data tree process txn ( hdr 1 , txn 1 ) ; / / finish the snapshot leader data tree serialize nodes ( oa ) ; os close ( ) ; / / simulate restore on follower and replay file input stream is = new file input stream ( file ) ; input archive ia = binary input archive get archive ( is ) ; data tree follower data tree = new data tree ( ) ; follower data tree deserialize ( ia , " tree " ) ; follower data tree process txn ( hdr 1 , txn 1 ) ; data node a 1 = leader data tree get node ( " / a 1 " ) ; assert not null ( a 1 ) ; assert equals ( zoo defs ids creator all acl , leader data tree get a c l ( a 1 ) ) ; assert equals ( zoo defs ids creator all acl , follower data tree get a c l ( a 1 ) ) ; }


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


sets a null value for the given setting key

public builder put null ( string key ) { return put ( key , ( string ) null ) ; }


calculate the shares for { @ code first } and { @ code second } according to { @ code cluster res } , and store the results in { @ code first shares } and { @ code second shares } , respectively { @ code max } will be populated with the max shares from { @ code first share } and { @ code second share } in the first and second indices , respectively all parameters must be non - null , and { @ code max } must have a length of at least 2

private void calculate shares ( resource information [ ] cluster res , resource first , resource second , double [ ] first shares , double [ ] second shares , double [ ] max ) { resource information [ ] first res = first get resources ( ) ; resource information [ ] second res = second get resources ( ) ; max [ 0 ] = 0 0 ; max [ 1 ] = 0 0 ; int max length = resource utils get number of countable resource types ( ) ; for ( int i = 0 ; i < max length ; i + + ) { first shares [ i ] = calculate share ( cluster res [ i ] , first res [ i ] ) ; second shares [ i ] = calculate share ( cluster res [ i ] , second res [ i ] ) ; if ( first shares [ i ] = = float positive infinity | | second shares [ i ] = = float positive infinity ) { continue ; } if ( first shares [ i ] > max [ 0 ] ) { max [ 0 ] = first shares [ i ] ; } if ( second shares [ i ] > max [ 1 ] ) { max [ 1 ] = second shares [ i ] ; } } }


clears cache for the specified hystrix command

protected void flush cache ( ) { if ( cache remove invocation context ! = null ) { hystrix request cache manager get instance ( ) clear cache ( cache remove invocation context ) ; } }


model tests for additional properties class

public void test additional properties class ( ) { / / todo : test additional properties class }


creates a new data set that contains elements in the iterator the iterator is splittable , allowing the framework to create a parallel data source that returns the elements in the iterator because the iterator will remain unmodified until the actual execution happens , the type of data returned by the iterator must be given explicitly in the form of the type class ( this is due to the fact that the java compiler erases the generic type information )

public < x > data source < x > from parallel collection ( splittable iterator < x > iterator , class < x > type ) { return from parallel collection ( iterator , type extractor get for class ( type ) ) ; }


public void test retry a w s connectivity ( ) throws throwable { final atomic integer counter = new atomic integer ( 0 ) ; invoker retry ( " test " , null , false , ( ) - > { if ( counter increment and get ( ) < active retry limit ) { throw client timeout exception ; } } ) ; assert equals ( active retry limit , counter get ( ) ) ; }


public void do rss ( stapler request req , stapler response rsp ) throws i o exception , servlet exception { do rss ( req , rsp , jenkins log records ) ; }


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


sets the size of the fragment to return from the beginning of the field if there are no matches to highlight and the field doesn ' t also define no match size

public hb no match size ( integer no match size ) { this no match size = no match size ; return ( hb ) this ; }


gets the end offset of this constant pool in the { @ code byte [ ] } which it came from

public int get end offset ( ) { parse if necessary ( ) ; return end offset ; }


extract the invocation result from the response message the default implementation expects a jms { @ link javax jms object message } carrying a { @ link remote invocation result } object if an invalid response message is encountered , the { @ code on invalid response } callback gets invoked

protected remote invocation result extract invocation result ( message response message ) throws j m s exception { object content = this message converter from message ( response message ) ; if ( content instanceof remote invocation result ) { return ( remote invocation result ) content ; } return on invalid response ( response message ) ; }


generate the hash smash for a superior idinferior full hash

public static long generate superior full hash smash ( function record superior function , function record inferior function ) { long hash value = superior function get key ( ) * f n v 1a 6 4 message digest fnv 64 prime ; / / improve bit diversity on key return hash value ^ inferior function get full hash ( ) ; }


reconstruct a set of blocks to full strength through replication or erasure coding

int compute reconstruction work for blocks ( list < list < block info > > blocks to reconstruct ) { int scheduled work = 0 ; list < block reconstruction work > recon work = new array list < > ( ) ; / / step 1 : categorize at - risk blocks into replication and ec tasks namesystem write lock ( ) ; try { synchronized ( needed reconstruction ) { for ( int priority = 0 ; priority < blocks to reconstruct size ( ) ; priority + + ) { for ( block info block : blocks to reconstruct get ( priority ) ) { block reconstruction work rw = schedule reconstruction ( block , priority ) ; if ( rw ! = null ) { recon work add ( rw ) ; } } } } } finally { namesystem write unlock ( ) ; } / / step 2 : choose target nodes for each reconstruction task for ( block reconstruction work rw : recon work ) { / / exclude all of the containing nodes from being targets / / this list includes decommissioning or corrupt nodes final set < node > excluded nodes = new hash set < > ( rw get containing nodes ( ) ) ; / / exclude all nodes which already exists as targets for the block list < datanode storage info > targets = pending reconstruction get targets ( rw get block ( ) ) ; if ( targets ! = null ) { for ( datanode storage info dn : targets ) { excluded nodes add ( dn get datanode descriptor ( ) ) ; } } / / choose replication targets : not holding the global lock final block placement policy placement policy = placement policies get policy ( rw get block ( ) get block type ( ) ) ; rw choose targets ( placement policy , storage policy suite , excluded nodes ) ; } / / step 3 : add tasks to the dn namesystem write lock ( ) ; try { for ( block reconstruction work rw : recon work ) { final datanode storage info [ ] targets = rw get targets ( ) ; if ( targets = = null | | targets length = = 0 ) { rw reset targets ( ) ; continue ; } synchronized ( needed reconstruction ) { if ( validate reconstruction work ( rw ) ) { scheduled work + + ; } } } } finally { namesystem write unlock ( ) ; } if ( block log is debug enabled ( ) ) { / / log which blocks have been scheduled for reconstruction for ( block reconstruction work rw : recon work ) { datanode storage info [ ] targets = rw get targets ( ) ; if ( targets ! = null & & targets length ! = 0 ) { string builder target list = new string builder ( " datanode ( s ) " ) ; for ( datanode storage info target : targets ) { target list append ( ' ' ) append ( target get datanode descriptor ( ) ) ; } block log debug ( " block * ask { } to replicate { } to { } " , rw get src nodes ( ) , rw get block ( ) , target list ) ; } } block log debug ( " block * needed reconstruction = { } pending reconstruction = { } " , needed reconstruction size ( ) , pending reconstruction size ( ) ) ; } return scheduled work ; }


generates the files for the ranks relation the ranks entries apply the following format : < br > < code > rank | url | average duration | \ n < code >

private static void gen ranks ( int no docs , string path ) { random rand = new random ( calendar get instance ( ) get time in millis ( ) ) ; try ( buffered writer fw = new buffered writer ( new file writer ( path ) ) ) { for ( int i = 0 ; i < no docs ; i + + ) { / / rank string builder rank = new string builder ( rand next int ( 100 ) + " | " ) ; / / url rank append ( " url " + i + " | " ) ; / / average duration rank append ( rand next int ( 10 ) + rand next int ( 50 ) + " | \ n " ) ; fw write ( rank to string ( ) ) ; } } catch ( i o exception e ) { e print stack trace ( ) ; } }


test serialization of outer boolean types

public void fake outer boolean serialize test ( ) throws i o exception { boolean body = null ; boolean response = api fake outer boolean serialize ( body ) ; / / todo : test validations }


public static boolean is leeco ( ) { return rom leeco [ 0 ] equals ( get rom info ( ) name ) ; }


create a blob that will exist for multiple app sessions the file will be created on disk synchronously , but the data will copied asynchronously this is helpful when the copy is long - running , such as in the case of recording a voice note it is the caller ' s responsibility to eventually call { @ link blob provider # delete ( context , uri ) } when the blob is no longer in use

public uri create for multiple sessions on disk async ( @ non null context context , @ nullable success listener success listener , @ nullable error listener error listener ) throws i o exception { return write blob spec to disk async ( context , build blob spec ( storage type multi session disk ) , success listener , error listener ) ; }


removes selected tags from the currently - selected function

public void remove selected tags ( ) { set < function tag > selected tags = get selected tags ( ) ; for ( function tag tag : selected tags ) { command cmd = new remove function tag cmd ( tag get name ( ) , function get entry point ( ) ) ; tool execute ( cmd , program ) ; } }


make sure emission - subscription races are handled correctly https : github com reactive x rx javaissues 1 1 4 7

public void race for terminal state ( ) { final list < integer > expected = arrays as list ( 1 ) ; for ( int i = 0 ; i < 100000 ; i + + ) { test subscriber ex < integer > ts = new test subscriber ex < > ( ) ; flowable just ( 1 ) subscribe on ( schedulers computation ( ) ) cache ( ) subscribe ( ts ) ; ts await done ( 5 , time unit seconds ) ; ts assert value sequence ( expected ) ; ts assert terminated ( ) ; } }


updates this map so that the given < code > key < code > maps to the given < code > value < code > if the map previously contained a mapping for < code > key < code > then that mapping is replaced and the previous value is returned

public v put ( k key , v value ) { process queue ( ) ; weak value < v > v = hash get ( key ) ; v old value = null ; if ( v ! = null ) { reverse hash remove ( v ) ; old value = v get ( ) ; } v = weak value create ( value , queue ) ; reverse hash put ( v , key ) ; hash put ( key , v ) ; return old value ; }


go over all the mounted items from the leaves to the root and unmount only the items that are not present in the new layout outputs if an item is still present but in a new position move the item inside its host the condition where an item changed host doesn ' t need any special treatment here since we mark them as removed and re - added when calculating the new layout outputs

private void unmount or move old items ( ) { if ( m render unit ids = = null ) { return ; } / / traversing from the beginning since m render unit ids unmounting won ' t remove entries there / / but only from m index to mounted item map if an host changes we ' re going to unmount it and / / recursively / / all its mounted children for ( int i = 0 ; i < m render unit ids length ; i + + ) { final int new position = m render tree get render tree node index ( m render unit ids [ i ] ) ; final render tree node render tree node = new position > - 1 ? m render tree get render tree node at index ( new position ) : null ; final mount item old item = get item at ( i ) ; final boolean has unmount delegate = m unmount delegate extension ! = null & & old item ! = null ? m unmount delegate extension should delegate unmount ( m mount delegate get unmount delegate extension state ( ) , old item ) : false ; if ( has unmount delegate ) { continue ; } if ( new position = = - 1 ) { / / if old item is null it was previously unmounted so there is nothing we need to do if ( old item ! = null ) { unmount item recursively ( old item get render tree node ( ) ) ; } } else { final long new host marker = render tree node get parent ( ) = = null ? 0l : render tree node get parent ( ) get render unit ( ) get id ( ) ; final host new host = m index to mounted item map get ( new host marker ) = = null ? null : ( host ) m index to mounted item map get ( new host marker ) get content ( ) ; if ( old item = = null ) { / / this was previously unmounted } else if ( old item get host ( ) ! = new host ) { / / if the id is the same but the parent host is different we simply unmount the item and / / re - mount it later if the item to unmount is a component host , all the children will be / / recursively unmounted unmount item recursively ( old item get render tree node ( ) ) ; } else if ( old item get render tree node ( ) get position in parent ( ) ! = render tree node get position in parent ( ) ) { / / if a mount item for this id exists and its host has not changed but its position / / in the host has changed we need to update the position in the host to ensure / / the z - ordering old item get host ( ) move item ( old item , old item get render tree node ( ) get position in parent ( ) , render tree node get position in parent ( ) ) ; } } } }


public void assert cursor ( int expected cursor ) { if ( cursor ! = expected cursor ) { throw new exception with context ( " expected cursor " + expected cursor + " ; actual value : " + cursor ) ; } }


returns { @ code true } if the regex implementation behaves like perl - - notably , by supporting possessive quantifiers but also being susceptible to catastrophic backtracking


returns the parameter from the last call to { @ link # marked writability ( boolean ) }

boolean marked writability ( ) { return marked writable ; }


determines if the cache should operate in read through mode

private boolean is read through ( ) { return config is read through ( ) & & ( config get cache loader factory ( ) ! = null ) ; }


set the date format used to parseformat date parameters

public api client set date format ( date format date format ) { this date format = date format ; / / also set the date format for model ( de ) serialization with date properties this json set date format ( ( date format ) date format clone ( ) ) ; return this ; }


public static void options ( string path , string accept type , route route , response transformer transformer ) { get instance ( ) options ( path , accept type , route , transformer ) ; }


ensure that there is no waiting ( sleep duration = 0 ) if the metrics have only been updated with successful requests

public void test only success then no waiting ( ) { client throttling analyzer analyzer = new client throttling analyzer ( " test " , analysis period ) ; analyzer add bytes transferred ( 8 * megabyte , false ) ; validate ( 0 , analyzer get sleep duration ( ) ) ; sleep ( analysis period plus 10 percent ) ; validate ( 0 , analyzer get sleep duration ( ) ) ; }


use the given { @ link clock } instance for the time

public builder with clock ( clock clock ) { this clock = clock ; return this ; }


adds element to the priority queue in log ( size ) time if either the priority queue is not full , or not less than ( element , top ( ) )

public boolean offer ( t element ) { if ( size < capacity ) { put ( element ) ; return true ; } else if ( size > 0 & & ! less than ( element , peek ( ) ) ) { heap [ 1 ] = element ; adjust top ( ) ; return true ; } else { return false ; } }


returns an output stream if the file can be opened for writing

public output stream get output stream ( ) throws file not found exception { return resource get output stream ( ) ; }


public < t > t execute ( function < response , t > handler ) { return handler apply ( rest assured given ( ) spec ( req spec build ( ) ) expect ( ) spec ( resp spec build ( ) ) when ( ) request ( req method , req uri ) ) ; }


notifies the registry about an unregistered kv state instance

public void notify kv state unregistered ( job vertex i d job vertex id , key group range key group range , string registration name ) { kv state location location = lookup table get ( registration name ) ; if ( location ! = null ) { / / duplicate name if vertex i ds don ' t match if ( ! location get job vertex id ( ) equals ( job vertex id ) ) { throw new illegal argument exception ( " another operator ( " + location get job vertex id ( ) + " ) registered the kv state " + " under ' " + registration name + " ' " ) ; } location unregister kv state ( key group range ) ; if ( location get num registered key groups ( ) = = 0 ) { lookup table remove ( registration name ) ; } } else { throw new illegal argument exception ( " unknown registration name ' " + registration name + " ' " + " probably registration / unregistration race " ) ; } }


return true if the field includes the { @ code public } modifier

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


given an { @ link input stream } parse it into an instance of the declared type so that it can be passed to application code

public t parse ( input stream stream ) ;


gets a mock context for initializing the source ' s state via { @ link org apache flink streaming api checkpoint checkpointed function # initialize state }

function initialization context get mock context ( ) throws exception { operator state store mock store = mockito mock ( operator state store class ) ; function initialization context mock context = mockito mock ( function initialization context class ) ; mockito when ( mock context get operator state store ( ) ) then return ( mock store ) ; mockito when ( mock store get list state ( any ( list state descriptor class ) ) ) then return ( null ) ; return mock context ; }


verify permission for a mount point when the actual destination is not present it returns the permissions of the mount point

public void test mount table permissions no dest ( ) throws i o exception { mount table add entry ; add entry = mount table new instance ( " / testdir 1 " , collections singleton map ( " ns 0 " , " / tmp / testdir 1 " ) ) ; add entry set group name ( " group 1 " ) ; add entry set owner name ( " owner 1 " ) ; add entry set mode ( fs permission create immutable ( ( short ) 0775 ) ) ; assert true ( add mount table ( add entry ) ) ; file status [ ] list = router fs list status ( new path ( " / " ) ) ; assert equals ( " group 1 " , list [ 0 ] get group ( ) ) ; assert equals ( " owner 1 " , list [ 0 ] get owner ( ) ) ; assert equals ( ( short ) 0775 , list [ 0 ] get permission ( ) to short ( ) ) ; }


returns { @ code true } if each element in { @ code iterable } after the first is strictly greater than the element that preceded it , according to the specified comparator note that this is always true when the iterable has fewer than two elements

public static < t > boolean is in strict order ( iterable < ? extends t > iterable , comparator < t > comparator ) { check not null ( comparator ) ; iterator < ? extends t > it = iterable iterator ( ) ; if ( it has next ( ) ) { t prev = it next ( ) ; while ( it has next ( ) ) { t next = it next ( ) ; if ( comparator compare ( prev , next ) > = 0 ) { return false ; } prev = next ; } } return true ; }


throws a { @ code s a x not recognized exception } exception when the given property does not signify a lexical handler the property name for a lexical handler is { @ code http : xml orgsaxpropertieslexical - handler }

public object get property ( string name ) throws s a x not recognized exception , s a x not supported exception { if ( " http : / / xml org / sax / properties / lexical - handler " equals ( name ) ) { return this lexical handler ; } else { throw new s a x not recognized exception ( name ) ; } }


public synchronized int get last buffer size ( ) { return last buffer size ; }


makes sure { @ link remote launcher } properly masks arguments

public void slave mask ( ) throws exception { argument list builder args = new argument list builder ( ) ; args add ( " java " ) ; args add masked ( " - version " ) ; slave s = j create online slave ( ) ; j show agent logs ( s , logging ) ; string writer out = new string writer ( ) ; assert equals ( 0 , s create launcher ( new stream task listener ( out ) ) launch ( ) cmds ( args ) join ( ) ) ; assert that ( out to string ( ) , contains string ( " $ java * * * * * * * * " ) ) ; }


creates a file in the java temp directory using the given name as a prefix and the given suffix the final filename will also include the current test name , as well as any data added by { @ link file # create temp file ( string , string ) } the file will be marked to delete on jvm exit this will not work if the jvm is taken down the hard way , as when pressing the stop button in eclipse note : this method < b > will < b > create the file on disk ! if you need the file to not exist , then you must delete the file yourself alternatively , you could instead call { @ link # create temp file path ( string , string ) } , which will ensure that the created temp file is deleted finally , this method will delete any files that match the given name and suffix values before creating the given temp file < b > this is important , as it will delete any files already created by the test that match this info < b >

public file create temp file ( string name , string suffix ) throws i o exception { string test method name = test name get method name ( ) ; / / these are the values used by file create temp file ( ) string prefix name = name ! = null ? name : " null " ; string suffix name = suffix ! = null ? suffix : " tmp " ; delete matching temp files ( prefix name + " * " + suffix name ) ; string test temp dir = get test directory path ( ) ; file dir = new file ( test temp dir ) ; string filename = prefix name + ' ' + test method name + ' ' ; file temp file = file create temp file ( filename , suffix name , dir ) ; temp file delete on exit ( ) ; return temp file ; }


find a jar that contains a class of the same name , if any it will return a jar file , even if that is not the first thing on the class path that has a class with the same name

public static string find containing jar ( class my class ) { return class util find containing jar ( my class ) ; }


the value reference combination to use , or all if unset

optional < reference type > values ( ) { return optional of nullable ( enums get if present ( reference type class , system get property ( " values " , " " ) to upper case ( ) ) or null ( ) ) ; }


assert that a path exists - but make no assertions as to the type of that entry

public static void assert path exists ( file system file system , string message , path path ) throws i o exception { try { file system get file status ( path ) ; } catch ( file not found exception e ) { / / failure , report it throw ( i o exception ) new file not found exception ( message + " : not found " + path + " in " + path get parent ( ) + " : " + e + " - - " + ls ( file system , path get parent ( ) ) ) init cause ( e ) ; } }


create a counter builder by given meter name

public static histogram builder histogram ( string name ) { return new histogram builder ( name ) ; }


reads the mapping file , ignoring comments and replacing placeholders for random types

private static string read mapping ( url resource ) throws i o exception { try ( buffered reader reader = test utils reader ( resource ) ) { string builder b = new string builder ( ) ; string line ; while ( ( line = reader read line ( ) ) ! = null ) { if ( line starts with ( " # " ) = = false ) { for ( entry < string , string [ ] > entry : replacement patterns entry set ( ) ) { line = line replace ( entry get key ( ) , random of ( entry get value ( ) ) ) ; } b append ( line ) ; } } return b to string ( ) ; } }


the comment associated with the & lt ; public & gt ; tag < code > optional string comment = 3 ; < code >

public java lang string get comment ( ) { return instance get comment ( ) ; }


public big decimal get number ( ) { return number ; }


determine whether to apply disappear animation to the given { @ link mount item }

private static boolean is item disappearing ( final transitions extension state state , transitions extension input input , int index ) { if ( ! should animate transitions ( state , input ) | | ! has transitions to animate ( state ) ) { return false ; } if ( state m transition manager = = null | | state m last transitions extension input = = null ) { return false ; } final animatable item animatable item = state m last transitions extension input get animatable item ( state m last transitions extension input get mountable output at ( index ) get render unit ( ) ) ; final transition id transition id = animatable item get transition id ( ) ; if ( transition id = = null ) { return false ; } return state m transition manager is disappearing ( transition id ) ; }


shows any previously created tool , creating a simple empty tool if not tool has yet been created the given program will be opened in the tool < p > this method is considered sub - standard and users should prefer instead { @ link # launch default tool ( ) } or { @ link # launch default tool ( program ) }

public plugin tool show tool ( program p ) { open ( p ) ; / / this call lazy tool ( ) plugin tool t = abstract ghidra headed integration test show tool ( lazy tool ( ) ) ; remove all consumers except tool ( p , t ) ; return t ; }


clears the { @ link cuttable # is cut ( ) is cut } flag on any g tree nodes that are pointed to by the system clipboard

public static void clear cuttables ( ) { clear cuttables ( get system clipboard transferable ( ) ) ; }


test inline additional properties ( asynchronously )

public okhttp 3 call test inline additional properties async ( map < string , string > param , final api callback < void > callback ) throws api exception { okhttp 3 call local var call = test inline additional properties validate before call ( param , callback ) ; local var api client execute async ( local var call , callback ) ; return local var call ; }


clear the cancellation so that this task monitor may be reused


returns whether data peeked from the current position in { @ code input } is consistent with the input being an unfragmented mp4 file

public static boolean sniff unfragmented ( extractor input input ) throws i o exception { return sniff internal ( input , false ) ; }


if this is not the first element of the streaming , use the previous not - null name as the service name

private void set service name ( log data builder builder ) { if ( string util is empty ( service name ) & & string util is not empty ( builder get service ( ) ) ) { service name = builder get service ( ) ; } else if ( string util is not empty ( service name ) ) { builder set service ( service name ) ; } }


create an auth token from a credential response

public groups v 2 authorization string get groups v 2 authorization string ( uuid self , int today , group secret params group secret params , auth credential response auth credential response ) throws verification failed exception { client zk auth operations auth operations = groups operations get auth operations ( ) ; auth credential auth credential = auth operations receive auth credential ( self , today , auth credential response ) ; auth credential presentation auth credential presentation = auth operations create auth credential presentation ( new secure random ( ) , group secret params , auth credential ) ; return new groups v 2 authorization string ( group secret params , auth credential presentation ) ; }


does the domain name match one of the " wildcard " patterns ( e g { @ code " ar " } ) ? if a { @ code desired type } is specified , the wildcard pattern must also match that type

private static boolean matches wildcard suffix type ( optional < public suffix type > desired type , string domain ) { list < string > pieces = dot splitter limit ( 2 ) split to list ( domain ) ; return pieces size ( ) = = 2 & & matches type ( desired type , optional from nullable ( public suffix patterns under get ( pieces get ( 1 ) ) ) ) ; }


gson should be able to deserialize a stream with non - exectuable token if it is created with { @ link gson builder # generate non executable json ( ) }

public void test json with non exectuable token with configured gson deserialization ( ) { / / gson should be able to deserialize a stream with non - exectuable token even if it is created gson gson = gson builder generate non executable json ( ) create ( ) ; string json = json non executable prefix + " { int value : 2 , string value : ' ) ] } \ \ u 0 0 2 7 \ \ n ' }


add a new evaluator to the gauge statistics

public dynamic i o statistics builder with long function gauge ( string key , to long function < string > eval ) { active instance ( ) add gauge function ( key , eval : : apply as long ) ; return this ; }


returns whether the given method accesses package visible classes or class members

public static boolean accesses package code ( method method ) { method optimization info info = method optimization info get method optimization info ( method ) ; return info = = null | | info accesses package code ( ) ; }


test connecting to an alternative host then common name , although only subject alternative names are used if present no special consideration of common name

@ test public void alternative then common ( ) throws exception { server enqueue ( new mock response ( ) ) ; server enqueue ( new mock response ( ) ) ; http url san url = url new builder ( ) host ( " san com " ) build ( ) ; assert 2 0 0 http 2 response ( execute ( san url ) , " san com " ) ; assert 2 0 0 http 2 response ( execute ( url ) , server get host name ( ) ) ; assert that ( client connection pool ( ) connection count ( ) ) is equal to ( 1 ) ; }


return a slice of records from this instance , which is a view into this set starting from the given position and with the given size limit if the size is beyond the end of the file , the end will be based on the size of the file at the time of the read if this message set is already sliced , the position will be taken relative to that slicing

public file records slice ( int position , int size ) throws i o exception { / / cache current size in case concurrent write changes it int current size in bytes = size in bytes ( ) ; if ( position < 0 ) throw new illegal argument exception ( " invalid position : " + position + " in read from " + this ) ; if ( position > current size in bytes - start ) throw new illegal argument exception ( " slice from position " + position + " exceeds end position of " + this ) ; if ( size < 0 ) throw new illegal argument exception ( " invalid size : " + size + " in read from " + this ) ; int end = this start + position + size ; / / handle integer overflow or if end is beyond the end of the file if ( end < 0 | | end > start + current size in bytes ) end = start + current size in bytes ; return new file records ( file , channel , this start + position , end , true ) ; }


variant of { @ link # body ( publisher , parameterized type reference ) } that allows using any producer that can be resolved to { @ link publisher } via { @ link reactive adapter registry }

mono < server response > body ( object producer , parameterized type reference < ? > element type ref ) ;


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


complete the earliest uncompleted call successfully

public synchronized boolean complete next ( ) { return error next ( null ) ; }


forget what happened so far and start measuring once again

void init instrumentation ( final string tag , perf listener perf listener ) ;


gets a handle to the system ' s keyvalue state the keyvalue state is only accessible if the function is executed on a keyed stream on each access , the state exposes the value for the key of the element currently processed by the function each function may have multiple partitioned states , addressed with different names because the scope of each value is the key of the currently processed element , and the elements are distributed by the flink runtime , the system can transparently scale out and redistribute the state and keyed stream the following code example shows how to implement a continuous counter that counts how many times elements of a certain key occur , and emits an updated count for that element on each occurrence { @ code data stream < my type > stream = ; keyed stream < my type > keyed stream = stream key by ( " id " ) ; keyed stream map ( new rich map function < my type , tuple 2 < my type , long > > ( ) { private value state < long > count ; public void open ( configuration cfg ) { state = get runtime context ( ) get state ( new value state descriptor < long > ( " count " , long serializer instance , 0l ) ) ; } public tuple 2 < my type , long > map ( my type value ) { long count = state value ( ) + 1 ; state update ( value ) ; return new tuple 2 < > ( value , count ) ; } } ) ; }

< t > value state < t > get state ( value state descriptor < t > state properties ) ;


restore a state that was previously returned by { @ link # save instance state } this adds to the activity group information about all activity i ds that had previously been saved , even if they have not been started yet , so if the user later navigates to them the correct state will be restored note : this does < b > not < b > change the current running activity , or start whatever activity was previously running when the state was saved that is up to the client to do , in whatever way it thinks is best

public void dispatch create ( bundle state ) { if ( state ! = null ) { for ( string id : state key set ( ) ) { try { final bundle astate = state get bundle ( id ) ; local activity record r = m activities get ( id ) ; if ( r ! = null ) { r instance state = astate ; } else { r = new local activity record ( id , null ) ; r instance state = astate ; m activities put ( id , r ) ; m activity array add ( r ) ; } } catch ( exception e ) { / / recover from - all - app errors log e ( tag , " exception thrown when restoring local activity manager state " , e ) ; } } } m cur state = created ; }


test an async flowable that emits more async observables

public void nested async concat ( ) throws interrupted exception { subscriber < string > subscriber = test helper mock subscriber ( ) ; final test observable < string > o 1 = new test observable < > ( " one " , " two " , " three " ) ; final test observable < string > o 2 = new test observable < > ( " four " , " five " , " six " ) ; final test observable < string > o 3 = new test observable < > ( " seven " , " eight " , " nine " ) ; final count down latch allow third = new count down latch ( 1 ) ; final atomic reference < thread > parent = new atomic reference < > ( ) ; final count down latch parent has started = new count down latch ( 1 ) ; final count down latch parent has finished = new count down latch ( 1 ) ; flowable < flowable < string > > observable of observables = flowable unsafe create ( new publisher < flowable < string > > ( ) { @ override public void subscribe ( final subscriber < ? super flowable < string > > subscriber ) { final disposable d = disposable empty ( ) ; subscriber on subscribe ( new subscription ( ) { @ override public void request ( long n ) { } @ override public void cancel ( ) { d dispose ( ) ; } } ) ; parent set ( new thread ( new runnable ( ) { @ override public void run ( ) { try { / / emit first if ( ! d is disposed ( ) ) { system out println ( " emit o 1 " ) ; subscriber on next ( flowable unsafe create ( o 1 ) ) ; } / / emit second if ( ! d is disposed ( ) ) { system out println ( " emit o 2 " ) ; subscriber on next ( flowable unsafe create ( o 2 ) ) ; } / / wait until sometime later and emit third try { allow third await ( ) ; } catch ( interrupted exception e ) { subscriber on error ( e ) ; } if ( ! d is disposed ( ) ) { system out println ( " emit o 3 " ) ; subscriber on next ( flowable unsafe create ( o 3 ) ) ; } } catch ( throwable e ) { subscriber on error ( e ) ; } finally { system out println ( " done parent flowable " ) ; subscriber on complete ( ) ; parent has finished count down ( ) ; } } } ) ) ; parent get ( ) start ( ) ; parent has started count down ( ) ; } } ) ; flowable concat ( observable of observables ) subscribe ( subscriber ) ; / / wait for parent to start parent has started await ( ) ; try { / / wait for first 2 async observables to complete system out println ( " thread 1 is starting waiting for it to complete " ) ; o 1 wait for thread done ( ) ; system out println ( " thread 2 is starting waiting for it to complete " ) ; o 2 wait for thread done ( ) ; } catch ( throwable e ) { throw new runtime exception ( " failed waiting on threads " , e ) ; } in order in order = in order ( subscriber ) ; in order verify ( subscriber , times ( 1 ) ) on next ( " one " ) ; in order verify ( subscriber , times ( 1 ) ) on next ( " two " ) ; in order verify ( subscriber , times ( 1 ) ) on next ( " three " ) ; in order verify ( subscriber , times ( 1 ) ) on next ( " four " ) ; in order verify ( subscriber , times ( 1 ) ) on next ( " five " ) ; in order verify ( subscriber , times ( 1 ) ) on next ( " six " ) ; / / we shouldn ' t have the following 3 yet in order verify ( subscriber , never ( ) ) on next ( " seven " ) ; in order verify ( subscriber , never ( ) ) on next ( " eight " ) ; in order verify ( subscriber , never ( ) ) on next ( " nine " ) ; / / we should not be completed yet verify ( subscriber , never ( ) ) on complete ( ) ; verify ( subscriber , never ( ) ) on error ( any ( throwable class ) ) ; / / now allow the third allow third count down ( ) ; try { / / wait for 3rd to complete o 3 wait for thread done ( ) ; } catch ( throwable e ) { throw new runtime exception ( " failed waiting on threads " , e ) ; } try { / / wait for the parent to complete if ( ! parent has finished await ( 5 , time unit seconds ) ) { fail ( " parent didn ' t finish within the time limit " ) ; } } catch ( throwable e ) { throw new runtime exception ( " failed waiting on threads " , e ) ; } in order verify ( subscriber , times ( 1 ) ) on next ( " seven " ) ; in order verify ( subscriber , times ( 1 ) ) on next ( " eight " ) ; in order verify ( subscriber , times ( 1 ) ) on next ( " nine " ) ; verify ( subscriber , never ( ) ) on error ( any ( throwable class ) ) ; in order verify ( subscriber , times ( 1 ) ) on complete ( ) ; }


update the environment of the native module

void update native ( immutable map builder < string , object > env ) ;


public void unref ( ) { cache unref ( this ) ; }


returns the number of buckets that has been chosen based on the initial configuration expert - level api

int get num buckets ( ) { return num buckets ; }


returns the upper case tabs of this m t config object

public boolean is upper case tabs ( ) { return upper case tabs ; }


defines a total order over float values positive and negative zero values compare equal na n compares equal to itself and greater than + inf

public int compare to ( starlark float that ) { double x = this v ; double y = that v ; if ( x > y ) { return + 1 ; } else if ( x < y ) { return - 1 ; } else if ( x = = y ) { return 0 ; / / 0 0 = = - 0 0 } / / at least one operand is na n / / canonicalize na ns using double to long bits and compare bits long xbits = double double to long bits ( x ) ; long ybits = double double to long bits ( y ) ; return long compare ( xbits , ybits ) ; / / na n > non - na n }


the user customised the output of the error messages - flush the buffered content into the main { @ link javax servlet jsp jsp writer }

protected void flush buffered body content ( body content body content ) throws jsp exception { try { body content write out ( body content get enclosing writer ( ) ) ; } catch ( i o exception ex ) { throw new jsp exception ( " unable to write buffered body content " , ex ) ; } }


external interface for setting the normalized version of the queue this class cannot normalize on it ' s own , but provides a way to store the normalized name of the target queue

public void update normalized queue ( string normalized queue name ) { this normalized queue = normalized queue name ; }


creates a placement constraint that has to be satisfied within a time window

public static timed placement constraint timed clock constraint ( abstract constraint constraint , long delay , time unit time unit ) { return new timed placement constraint ( constraint , time unit to millis ( delay ) , timed placement constraint delay unit milliseconds ) ; }


set whether to always apply the { @ code message format } rules , parsing even messages without arguments default is " false " : messages without arguments are by default returned as - is , without parsing them through message format set this to " true " to enforce message format for all messages , expecting all message texts to be written with message format escaping for example , message format expects a single quote to be escaped as " ' ' " if your message texts are all written with such escaping , even when not defining argument placeholders , you need to set this flag to " true " else , only message texts with actual arguments are supposed to be written with message format escaping

public void set always use message format ( boolean always use message format ) { this always use message format = always use message format ; }


updates the state with the given service transition this method performs the main logic of service manager in the following steps update the { @ link # services by state ( ) } update the { @ link # startup timers } based on the new state queue listeners to run run the listeners ( outside of the lock )

void transition service ( final service service , state from , state to ) { check not null ( service ) ; check argument ( from ! = to ) ; monitor enter ( ) ; try { transitioned = true ; if ( ! ready ) { return ; } / / update state check state ( services by state remove ( from , service ) , " service % s not at the expected location in the state map % s " , service , from ) ; check state ( services by state put ( to , service ) , " service % s in the state map unexpectedly at % s " , service , to ) ; / / update the timer stopwatch stopwatch = startup timers get ( service ) ; if ( stopwatch = = null ) { / / this means the service was started by some means other than service manager start async stopwatch = stopwatch create started ( ) ; startup timers put ( service , stopwatch ) ; } if ( to compare to ( running ) > = 0 & & stopwatch is running ( ) ) { / / n b if we miss the starting event then we may never record a startup time stopwatch stop ( ) ; if ( ! ( service instanceof no op service ) ) { logger log ( level fine , " started { 0 } in { 1 } " , new object [ ] { service , stopwatch } ) ; } } / / queue our listeners / / did a service fail ? if ( to = = failed ) { enqueue failed event ( service ) ; } if ( states count ( running ) = = number of services ) { / / this means that the manager is currently healthy n b if other threads call is healthy / / they are not guaranteed to get ' true ' , because any service could fail right now enqueue healthy event ( ) ; } else if ( states count ( terminated ) + states count ( failed ) = = number of services ) { enqueue stopped event ( ) ; } } finally { monitor leave ( ) ; / / run our executors outside of the lock dispatch listener events ( ) ; } }


given a group path , find its corresponding tree path object

private tree path find tree path ( group path group path ) { for ( int i = 0 ; i < node list size ( ) ; i + + ) { program node node = node list get ( i ) ; group path p = node get group path ( ) ; if ( p equals ( group path ) ) { return node get tree path ( ) ; } } return null ; }


public pet get pet by id ( long pet id ) throws api exception { object local var post body = null ; / / verify the required parameter ' pet id ' is set if ( pet id = = null ) { throw new api exception ( 400 , " missing the required parameter ' pet id ' when calling get pet by id " ) ; } / / create path and map variables string local var path = " / pet / { pet id } " replace all ( " \ \ { format \ \ } " , " json " ) replace all ( " \ \ { " + " pet id " + " \ \ } " , api client escape string ( pet id to string ( ) ) ) ; / / query params list < pair > local var 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 > ( ) ; final string [ ] local var accepts = { " application / xml " , " application / json " } ; final string local var accept = api client select header accept ( local var accepts ) ; final string [ ] local var content types = { } ; final string local var content type = api client select header content type ( local var content types ) ; string [ ] local var auth names = new string [ ] { " api key " } ; generic type < pet > local var return type = new generic type < pet > ( ) { } ; return api client invoke a p i ( local var path , " get " , local var query params , local var post body , local var header params , local var cookie params , local var form params , local var accept , local var content type , local var auth names , local var return type ) ; }


attempts to cancel the { @ link timer task } associated with this handle if the task has been executed or cancelled already , it will return with no side effect


tests a basic single threaded read scenario for page blobs

public void test single threaded page blob read scenario ( ) throws throwable { azure blob storage test account test account = get page blob test storage account ( ) ; setup input stream to test ( test account ) ; byte [ ] read buffer = new byte [ 512 ] ; input stream read ( read buffer ) ; }


indicates that the caller is momentarily unable to progress , until the occurrence of one or more actions on the part of other activities by invoking this method within each iteration of a spin - wait loop construct , the calling thread indicates to the runtime that it is busy - waiting the runtime may take action to improve the performance of invoking spin - wait loop constructions

public static void on spin wait ( ) { / / call java lang thread on spin wait ( ) on java se versions that support it do nothing otherwise / / this should optimize away to either nothing or to an inlining of java lang thread on spin wait ( ) if ( null ! = on spin wait method handle ) { try { on spin wait method handle invoke exact ( ) ; } catch ( final throwable ignore ) { } } }


this test triggers a failure in the listener - the expectation is that the service has already reached it ' s desired state , purely because the notifications take place afterwards

public void test listener failure ( ) { listener set failing state ( service state inited ) ; register ( ) ; breakable state change listener l 2 = new breakable state change listener ( ) ; register ( l 2 ) ; breakable service service = new breakable service ( ) ; service init ( new configuration ( ) ) ; / / expected notifications to fail / / still should record its invocation assert listener state ( listener , service state inited ) ; assert listener event count ( listener , 1 ) ; / / and second listener didn ' t get notified of anything assert listener event count ( l 2 , 0 ) ; / / service should still consider itself started assert service state inited ( service ) ; service start ( ) ; service stop ( ) ; }


template method for changing properties on the given { @ link socket channel config } the default implementation sets the connect timeout based on the set property

protected void configure channel ( socket channel config config ) { if ( this connect timeout > = 0 ) { config set connect timeout millis ( this connect timeout ) ; } }


return a new prepared statement creator for the given parameters

public prepared statement creator new prepared statement creator ( string sql to use , @ nullable object [ ] params ) { return new prepared statement creator impl ( sql to use , params ! = null ? arrays as list ( params ) : collections empty list ( ) ) ; }


populates the jython combo box with discovered jython names

private void populate jython combo ( ) { jython combo remove all ( ) ; try { for ( string jython name : py dev utils get jython 2 7 interpreter names ( ) ) { jython combo add ( jython name ) ; } } catch ( operation not supported exception e ) { / / nothing to do combo should and will be empty } if ( jython combo get item count ( ) > 0 ) { jython combo select ( 0 ) ; } }


specify the name of the jms message property that carries the type id for the contained object : either a mapped id value or a raw java class name default is none < b > note : this property needs to be set in order to allow for converting from an incoming message to a java object < b >

public void set type id property name ( string type id property name ) { this type id property name = type id property name ; }


return whether this helper is in multipart mode , i e whether it holds a multipart message

public final boolean is multipart ( ) { return ( this root mime multipart ! = null ) ; }


decrypt the { @ code key store } , prompting the user to enter the password in the { @ link terminal } if it is password protected

protected static void decrypt key store ( key store wrapper key store , terminal terminal ) throws user exception , i o exception { try ( secure string keystore password = key store has password ( ) ? read password ( terminal , false ) : new secure string ( new char [ 0 ] ) ) { key store decrypt ( keystore password get chars ( ) ) ; } catch ( security exception | general security exception e ) { throw new user exception ( exit codes data error , e get message ( ) ) ; } }


public integer get int 3 2 ( ) { return int 3 2 ; }


invokes { @ link video renderer event listener # on video frame processing offset }

public void report video frame processing offset ( long total processing offset us , int frame count ) { if ( handler ! = null ) { handler post ( ( ) - > cast non null ( listener ) on video frame processing offset ( total processing offset us , frame count ) ) ; } }


returns the list of x d s servers to be connected to

list < server info > get servers ( ) { return collections unmodifiable list ( servers ) ; }


returns the { @ code k } greatest elements of the given iterable according to this ordering , in order from greatest to least if there are fewer than { @ code k } elements present , all will be included the implementation does not necessarily use a stable sorting algorithm ; when multiple elements are equivalent , it is undefined which will come first < b > java 8 users : < b > continue to use this method for now after the next release of guava , use { @ code streams stream ( iterable ) collect ( comparators greatest ( k , this comparator ) ) } instead

public < e extends t > list < e > greatest of ( iterable < e > iterable , int k ) { / / todo ( kevinb ) : see if delegation is hurting performance noticeably / / todo ( kevinb ) : if we change this implementation , add full unit tests return reverse ( ) least of ( iterable , k ) ; }


this implementation throws an unsupported operation exception

public void add transformer ( class transformer class transformer ) { throw new unsupported operation exception ( " add transformer not supported " ) ; }


resolve the given error code into message codes for the given field calls the configured { @ link message codes resolver } with appropriate parameters

string [ ] resolve message codes ( string error code , string field ) ;


returns the encoding and channel config to use when configuring an { @ link audio track } in passthrough mode for the specified { @ link format } returns { @ code null } if passthrough of the format is unsupported

private static pair < integer , integer > get encoding and channel config for passthrough ( format format , @ nullable audio capabilities audio capabilities ) { if ( audio capabilities = = null ) { return null ; } @ c encoding int encoding = mime types get encoding ( assertions check not null ( format sample mime type ) , format codecs ) ; / / check for encodings that are known to work for passthrough with the implementation in this / / class this avoids trying to use passthrough with an encoding where the device / app reports / / it ' s capable but it is untested or known to be broken ( for example aac - lc ) boolean supported encoding = encoding = = c encoding ac3 | | encoding = = c encoding e ac3 | | encoding = = c encoding e ac3 joc | | encoding = = c encoding ac4 | | encoding = = c encoding dts | | encoding = = c encoding dts hd | | encoding = = c encoding dolby truehd ; if ( ! supported encoding ) { return null ; } / / e - ac3 joc is object based , so any channel count specified in the format is arbitrary use 6 , / / since the e - ac3 compatible part of the stream is 5 1 int channel count = encoding = = c encoding e ac3 joc ? 6 : format channel count ; if ( channel count > audio capabilities get max channel count ( ) ) { return null ; } int channel config = get channel config for passthrough ( channel count ) ; if ( channel config = = audio format channel invalid ) { return null ; } if ( audio capabilities supports encoding ( encoding ) ) { return pair create ( encoding , channel config ) ; } else if ( encoding = = c encoding e ac3 joc & & audio capabilities supports encoding ( c encoding e ac3 ) ) { / / e - ac3 receivers support e - ac3 joc streams ( but decode in 2 - d rather than 3 - d ) return pair create ( c encoding e ac3 , channel config ) ; } return null ; }


returns the first { @ link component } of the given type inside of the given dialog

public static < t extends component > t find component ( dialog component provider provider , class < t > desired class ) { return find component ( provider get component ( ) , desired class ) ; }


public status enum get status ( ) { return status ; }


prepare a response for a request matching the provided matcher if the matcher does not match , { @ link kafka client # send ( client request , long ) } will throw illegal state exception

public void prepare response ( request matcher matcher , abstract response response ) { prepare response ( matcher , response , false ) ; }


returns whether incremental mount is enabled or not in this component

public boolean is incremental mount enabled ( ) { return m incremental mount enabled ; }


public collection < f s leaf queue > get leaf queues ( ) { synchronized ( queues ) { return leaf queues ; } }


perform the given action as the daemon ' s login user if the login user cannot be determined , this will log a fatal error and exit the whole jvm

public static < t > t do as login user or fatal ( privileged action < t > action ) { if ( user group information is security enabled ( ) ) { user group information ugi = null ; try { ugi = user group information get login user ( ) ; } catch ( i o exception e ) { log error ( " exception while getting login user " , e ) ; e print stack trace ( ) ; runtime get runtime ( ) exit ( - 1 ) ; } return ugi do as ( action ) ; } else { return action run ( ) ; } }


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


test serialization of object with outer number type

outer composite fake outer composite serialize ( outer composite body ) ;


return a hex string form of an object ' s identity hash code

public static string get identity hex string ( object obj ) { return integer to hex string ( system identity hash code ( obj ) ) ; }


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

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


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


executes the provided request using either the sync method or its async variant , both provided as functions this variant is used when the call does not have a request object ( only headers and the request path )

protected static < resp > resp execute ( sync method no request < resp > sync method no request , async method no request < resp > async method no request , request options request options ) throws i o exception { if ( async = = false ) { return sync method no request execute ( request options ) ; } else { plain action future < resp > future = plain action future new future ( ) ; async method no request execute ( request options , future ) ; return future action get ( ) ; } }


filters the mutable input client - side when there ' s a clash on lower 64 - bits of a trace id

public static mapper < list < list < span > > , list < list < span > > > filter traces ( query request request ) { return new filter traces if clash on lower trace id ( request ) ; }


bind the socket factory to a given channel mode

private delegating s s l socket factory s s l channel mode bind socket factory ( final delegating s s l socket factory s s l channel mode channel mode ) throws i o exception { delegating s s l socket factory reset default factory ( ) ; configuration conf = new configuration ( false ) ; conf set ( ssl channel mode , channel mode name ( ) ) ; client configuration aws conf = new client configuration ( ) ; aws conf set protocol ( protocol https ) ; bind s s l channel mode ( conf , aws conf ) ; return delegating s s l socket factory get default factory ( ) get channel mode ( ) ; }


tests rolling edit logs while transactions are ongoing

public void test edit log rolling ( ) throws exception { / / start a cluster configuration conf = get conf ( ) ; final mini d f s cluster cluster = new mini d f s cluster builder ( conf ) num data nodes ( num data nodes ) build ( ) ; file system file sys = null ; atomic reference < throwable > caught err = new atomic reference < throwable > ( ) ; try { cluster wait active ( ) ; file sys = cluster get file system ( ) ; final namenode protocols nn = cluster get name node ( ) get rpc server ( ) ; f s image fsimage = cluster get namesystem ( ) get f s image ( ) ; storage directory sd = fsimage get storage ( ) get storage dir ( 0 ) ; start transaction workers ( cluster , caught err ) ; long previous log tx id = 1 ; for ( int i = 0 ; i < num rolls & & caught err get ( ) = = null ; i + + ) { try { thread sleep ( 20 ) ; } catch ( interrupted exception e ) { } log info ( " starting roll " + i + " " ) ; checkpoint signature sig = nn roll edit log ( ) ; long next log = sig cur segment tx id ; string log file name = n n storage get finalized edits file name ( previous log tx id , next log - 1 ) ; previous log tx id + = verify edit logs ( cluster get namesystem ( ) , fsimage , log file name , previous log tx id ) ; assert equals ( previous log tx id , next log ) ; file expected log = n n storage get in progress edits file ( sd , previous log tx id ) ; assert true ( " expect " + expected log + " to exist " , expected log exists ( ) ) ; } } finally { stop transaction workers ( ) ; if ( caught err get ( ) ! = null ) { throw new runtime exception ( caught err get ( ) ) ; } if ( file sys ! = null ) file sys close ( ) ; if ( cluster ! = null ) cluster shutdown ( ) ; } }


simple ' debug ' logging of stats warning : the caller is responsible for synchronization

private void log stats ( ) { if ( f log is loggable ( f log verbose ) ) { f log v ( tag , " used = ( % d , % d ) ; free = ( % d , % d ) " , m used m count , m used m num bytes , m free m count , m free m num bytes ) ; } }


gets the random number generator to use for this operation

protected random get random ( ) { return this rnd ; }


sets a node labels provider to the node manager

void set node labels provider ( node labels provider provider ) ;


returns the die pointed to by a dw at containing type attribute

public d i e aggregate get containing type ref ( ) { return get ref ( d w a r f attribute dw at containing type ) ; }


restricted constructors to ensure v 1 or v 2 , not both

public static s 3 list result v 2 ( list objects v 2 result result ) { return new s 3 list result ( null , result ) ; }


returns the total number of uncompressed bytes output so far

public synchronized long get bytes written ( ) { check stream ( ) ; return get bytes written ( stream ) ; }


public void set timeout ( int timeout secs ) { this timeout = timeout secs ; }


returns the cloned reference if valid , null otherwise

public static < t > closeable reference < t > clone or null ( @ nullable closeable reference < t > ref ) { return ( ref ! = null ) ? ref clone or null ( ) : null ; }


applies the provided { @ code function } to the state associated with the provided { @ code state descriptor }

public abstract < vs , s extends state > void apply to keyed state ( final state descriptor < s , vs > state descriptor , final keyed state function < ks , s > function ) throws exception ;


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


public response request post ( string url , string body , map < string , string > headers ) { return request http method ( url , body , headers , " post " ) ; }


test { @ link array writable } constructor with null

public void test null argument ( ) { new array writable ( ( class < ? extends writable > ) null ) ; }


initializes the spark server should just be used when using the websockets functionality

public static void init ( ) { get instance ( ) init ( ) ; }


called once the upstream sets a { @ link subscription } on this { @ code resource subscriber } you can perform initialization at this moment the default implementation requests { @ link long # max value } from upstream

protected void on start ( ) { request ( long max value ) ; }


gets the executable path of this maven on the given target system

public string get executable ( launcher launcher ) throws i o exception , interrupted exception { return launcher get channel ( ) call ( new get executable ( get home ( ) ) ) ; }


return the minimal value from a set of values

static < t extends comparable < t > > t get min value script ( map < string , object > vars , t initial value , string field name , function < object , t > converter ) { t retval = initial value ; map < ? , ? > doc = ( map ) vars get ( " doc " ) ; script doc values < ? > values = ( script doc values < ? > ) doc get ( field name ) ; for ( object v : values ) { t value = converter apply ( v ) ; retval = ( value compare to ( retval ) < 0 ) ? value : retval ; } return retval ; }


the open interface for other classes in crud package to update using model class to decide which table to update , and id to decide a specific row the value that need to update is stored in content values

public int on update ( class < ? > model class , long id , content values values ) { if ( values size ( ) > 0 ) { convert content values ( values ) ; return m database update ( get table name ( model class ) , values , " id = " + id , null ) ; } return 0 ; }


returns a { @ code char sequence } of the subsequence from the { @ code start } index to the { @ code end } index

public char sequence sub sequence ( int start , int end ) { return substring ( start , end ) ; }


inject a fake ' received ' block into the b p service actor state

private void inject block received ( ) { received deleted block info rdbi = new received deleted block info ( get dummy block ( ) , block status received block , null ) ; datanode storage s = singleton dn get f s dataset ( ) get storage ( storage uuid ) ; actor get ibr manager ( ) notify namenode block ( rdbi , s , false ) ; }


override this method to return a custom widget informing the that their browser lacks support of web g l

public widget get no web g l support widget ( ) { return new label ( " sorry , your browser doesn ' t seem to support web g l " ) ; }


releases an instance of the given server - side { @ link ssl context provider } the instance must have been obtained from { @ link # find or create server ssl context provider } otherwise will throw illegal argument exception caller must not release a reference more than once it ' s advised that you clear the reference to the instance with the null returned by this method

ssl context provider release server ssl context provider ( ssl context provider ssl context provider ) ;


creates a pixmap from a part of the current framebuffer

public static pixmap create from frame buffer ( int x , int y , int w , int h ) { gdx gl gl pixel storei ( gl20 gl pack alignment , 1 ) ; final pixmap pixmap = new pixmap ( w , h , format rgba8888 ) ; byte buffer pixels = buffer utils new byte buffer ( h * w * 4 ) ; gdx gl gl read pixels ( x , y , w , h , gl20 gl rgba , gl20 gl unsigned byte , pixels ) ; pixmap set pixels ( pixels ) ; return pixmap ; }


return the message associated with the event here is an example of obtaining information about the session id or any headers in the message : < pre class = " code " > stomp header accessor headers = stomp header accessor wrap ( message ) ; headers get session id ( ) ; headers get session attributes ( ) ; headers get principal ( ) ;

public message < byte [ ] > get message ( ) { return this message ; }


attempt to add an extension to install into this instance

public void add extension ( file extension to install ) { add extension ( extension to install get name ( ) , new file extension ( extension to install ) ) ; }


specify the phase in which this endpoint manager should be started and stopped the startup order proceeds from lowest to highest , and the shutdown order is the reverse of that by default this value is integer max value meaning that this endpoint manager starts as late as possible and stops as soon as possible

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


get a long test property look up configuration value ( which can pick up core - default xml ) , using { @ code def val } as the default value ( if conf ! = null ) fetch the system property if the system property is not empty or " ( unset ) " : it overrides the conf value this puts the build properties in charge of everything it ' s not a perfect design ; having maven set properties based on a file , as ant let you do , is better for customization as to why there ' s a special ( unset ) value , see { @ link http : stackoverflow comquestions 7 7 7 3 1 3 4null - versus - empty - arguments - in - maven }

public static long get test property long ( configuration conf , string key , long def val ) { return long value of ( get test property ( conf , key , long to string ( def val ) ) ) ; }


public i logger factory get logger factory ( ) { return logger factory ; }


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


get the process id from specified file path parses each line to find a valid number and returns the first one found

public static string get process id ( path path ) throws i o exception { if ( path = = null ) { throw new i o exception ( " trying to access process id from a null path " ) ; } log debug ( " accessing pid from pid file { } " , path ) ; string process id = null ; buffered reader buf reader = null ; try { file file = new file ( path to string ( ) ) ; if ( file exists ( ) ) { file input stream fis = new file input stream ( file ) ; buf reader = new buffered reader ( new input stream reader ( fis , " utf - 8 " ) ) ; while ( true ) { string line = buf reader read line ( ) ; if ( line = = null ) { break ; } string temp = line trim ( ) ; if ( ! temp is empty ( ) ) { if ( shell windows ) { / / on windows , pid is expected to be a container id , so find first / / line that parses successfully as a container id try { container id from string ( temp ) ; process id = temp ; break ; } catch ( exception e ) { / / do nothing } } else { / / otherwise , find first line containing a numeric pid try { long pid = long parse long ( temp ) ; if ( pid > 0 ) { process id = temp ; break ; } } catch ( exception e ) { / / do nothing } } } } } } finally { if ( buf reader ! = null ) { buf reader close ( ) ; } } log debug ( " got pid { } from path { } " , ( process id ! = null ? process id : " null " ) , path ) ; return process id ; }


run distributed checkup for the specified directory

public void test f s blocks ( string root name ) throws exception { create input file ( root name ) ; run distributed f s check ( ) ; cleanup ( ) ; / / clean up after all to restore the system state }


return all registered exception listener delegates ( as array )

public final exception listener [ ] get delegates ( ) { return this delegates to array ( new exception listener [ 0 ] ) ; }


updates a pet in the store with form data

public void update pet with form test ( ) { long pet id = null ; string name = null ; string status = null ; api update pet with form ( pet id , name , status ) ; / / todo : test validations }


the expires in param from o auth is in seconds - from - now convert to milliseconds - from - epoch

static long convert expires in ( timer timer , string expires in secs ) { long expires secs = long parse long ( expires in secs ) ; long expires ms = expires secs * 1000 ; return timer now ( ) + expires ms ; }


enter a parse tree produced by the { @ code value expression default } labeled alternative in { @ link eql base parser # value expression }

void enter value expression default ( eql base parser value expression default context ctx ) ;


returns the preferred locations for the slot

public collection < task manager location > get preferred locations ( ) { return preferred locations ; }


return the next id suffix to use when creating the log file this method will look at the files in the directory , find the one with the highest id suffix , and 1 to that suffix , and return it this approach saves a full linear probe , which matters in the case where there are a large number of log files

private int get next id to try ( path initial , int last id ) throws i o exception { remote iterator < located file status > files = file system list files ( current dir path , true ) ; string base = initial to string ( ) ; int id = last id ; while ( files has next ( ) ) { string file = files next ( ) get path ( ) get name ( ) ; if ( file starts with ( base ) ) { int file id = extract id ( file ) ; if ( file id > id ) { id = file id ; } } } / / return either 1 more than the highest we found or 1 more than the last / / id used ( if no id was found ) return id + 1 ; }


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


initiate shutdown , but do not wait for it to complete

public void begin shutdown ( ) { if ( ! shutdown executor is shutdown ( ) ) { shutdown executor submit ( ( callable < void > ) ( ) - > { try { log info ( " stopping rest server " ) ; jetty server stop ( ) ; jetty server join ( ) ; log info ( " rest server stopped " ) ; } catch ( exception e ) { log error ( " unable to stop rest server " , e ) ; } finally { jetty server destroy ( ) ; } shutdown executor shutdown ( ) ; return null ; } ) ; } }