returns an { @ link ascii string } containing the given string and retainscaches the input string for later use in { @ link # to string ( ) } used for the constants ( which already stored in the jvm ' s string table ) and in cases where the guaranteed use of the { @ link # to string ( ) } method

public static ascii string cached ( string string ) { ascii string ascii string = new ascii string ( string ) ; ascii string string = string ; return ascii string ; }


return true if the given code unit follows directly after this code unit

public boolean is successor ( code unit code unit ) { address min = code unit get min address ( ) ; return this get max address ( ) is successor ( min ) ; }


parses a header value into it ' s parts follows https : tools ietf orghtmlrfc 7 2 3 1 # section - 3 1 1 1 but allows only single media type media ranges will be ignored ( treated as not provided ) note : parsing can return null , but it will throw exceptions once https : github comelasticelasticsearchissues 6 3 0 8 0 is done todo do not rely on nulls

public static parsed media type parse media type ( string header value ) { if ( header value ! = null ) { if ( is media range ( header value ) | | " * / * " equals ( header value ) ) { return null ; } final string [ ] elements = header value to lower case ( locale root ) split ( " [ \ \ s \ \ t ] * ; " ) ; final string [ ] split media type = elements [ 0 ] split ( " / " ) ; if ( ( split media type length = = 2 & & tchar pattern matcher ( split media type [ 0 ] trim ( ) ) matches ( ) & & tchar pattern matcher ( split media type [ 1 ] trim ( ) ) matches ( ) ) = = false ) { throw new illegal argument exception ( " invalid media - type [ " + header value + " ] " ) ; } if ( elements length = = 1 ) { return new parsed media type ( header value , split media type [ 0 ] trim ( ) , split media type [ 1 ] trim ( ) , new hash map < > ( ) ) ; } else { map < string , string > parameters = new hash map < > ( ) ; for ( int i = 1 ; i < elements length ; i + + ) { string params as string = elements [ i ] trim ( ) ; if ( params as string is empty ( ) ) { continue ; } / / spaces are allowed between parameters , but not between ' = ' sign string [ ] key value param = params as string split ( " = " ) ; if ( key value param length ! = 2 | | has trailing space ( key value param [ 0 ] ) | | has leading space ( key value param [ 1 ] ) ) { throw new illegal argument exception ( " invalid parameters for header [ " + header value + " ] " ) ; } string parameter name = key value param [ 0 ] to lower case ( locale root ) trim ( ) ; string parameter value = key value param [ 1 ] to lower case ( locale root ) trim ( ) ; parameters put ( parameter name , parameter value ) ; } return new parsed media type ( header value , split media type [ 0 ] trim ( ) to lower case ( locale root ) , split media type [ 1 ] trim ( ) to lower case ( locale root ) , parameters ) ; } } return null ; }


test sparse watch case where only one watcher watches all paths , and only one path being watched by all watchers the output of this test will be the average time used to add those sparse watches

public void test add sparse watch ( add sparse watch state state ) throws exception { / / all watchers are watching the 1st path for ( watcher watcher : state watchers ) { if ( state watch manager add watch ( state paths [ 0 ] , watcher ) ) { state watches added + + ; } } / / the 1st watcher is watching all paths for ( string path : state paths ) { if ( state watch manager add watch ( path , state watchers [ 0 ] ) ) { state watches added + + ; } } }


public set < multifactor authentication trust record > get record for principal ( final string principal ) { val keys = new hash map < string , attribute value > ( ) ; keys put ( column names principal get column name ( ) , attribute value builder ( ) s ( string value of ( principal ) ) build ( ) ) ; return get records by keys ( keys , comparison operator eq ) ; }


public list < log record > get log records ( ) { return handler get view ( ) ; }


public boolean equals ( object obj ) { if ( obj = = this ) return true ; if ( obj ! = null & & obj instanceof summation ) { final summation that = ( summation ) obj ; return this n equals ( that n ) & & this e equals ( that e ) ; } throw new illegal argument exception ( obj = = null ? " obj = = null " : " obj get class ( ) = " + obj get class ( ) ) ; }


test { @ link reporter } ' s progress for a map - only job this will make sure that only the map phase decides the attempt ' s progress

public void test reporter progress for map only job ( ) throws i o exception { path test = new path ( test root temp dir , " test reporter progress for map only job " ) ; job conf conf = new job conf ( ) ; conf set mapper class ( progress tester mapper class ) ; conf set map output key class ( text class ) ; / / fail early conf set max map attempts ( 1 ) ; conf set max reduce attempts ( 0 ) ; running job job = utils for tests run job ( conf , new path ( test , " in " ) , new path ( test , " out " ) , 1 , 0 , input ) ; job wait for completion ( ) ; assert true ( " job failed " , job is successful ( ) ) ; }


sets the base url to the location where the open a p i document is being served

public api client set base path ( string base path ) { this base path = base path ; set oauth base path ( base path ) ; return this ; }


public web test client response spec reason equals ( string reason ) { string actual = this exchange result get status ( ) get reason phrase ( ) ; string message = " response status reason " ; this exchange result assert with diagnostics ( ( ) - > assertion errors assert equals ( message , reason , actual ) ) ; return this response spec ; }


public type list with added type ( type type ) { throw new unsupported operation exception ( " unsupported " ) ; }


get the optional object value associated with an index

public object opt ( int index ) { return ( index < 0 | | index > = length ( ) ) ? null : this my array list get ( index ) ; }


convert the given object to string with each line indented by 4 spaces ( except the first line )

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


public void get pet by id test ( test context test context ) { async async = test context async ( ) ; long pet id = null ; api get pet by id ( pet id , result - > { / / todo : test validations async complete ( ) ; } ) ; }


get the program location for the given program and save state object

public static program location get location ( program program , save state save state ) { string class name = save state get string ( " classname " , null ) ; if ( class name = = null ) { return null ; } try { class < ? > loc class = class for name ( class name ) ; program location loc = ( program location ) loc class get constructor ( ) new instance ( ) ; loc restore state ( program , save state ) ; if ( loc get address ( ) ! = null ) { return loc ; } / / no address , it must be in a removed block ; we can ' t use it } catch ( runtime exception e ) { / / restore state may not parse the address if it is no longer valid } catch ( class not found exception e ) { / / not sure why we are ignoring this - - if you know , then please let everyone else know } catch ( instantiation exception | illegal access exception | no such method exception e ) { msg show error ( program location class , null , " programming error " , " class " + class name + " must have public default constructor ! " , e ) ; } catch ( invocation target exception e ) { msg show error ( program location class , null , " programming error " , " class " + class name + " default constructor threw an exception ! " , e ) ; } return null ; }


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


< code > optional bytes msg = 7 ; < code >

public com google protobuf byte string get msg ( ) { return msg ; }


private int get registers size ( ) { return code get insns ( ) get registers size ( ) ; }


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

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


fixme check @ parameter ( required = true ) and any conditions that need to match

public boolean is valid ( ) { return true ; }


to have the usernamepassword authenticated by the container , submit the form to the url defined by the servlet spec

public string get authentication gateway url ( ) { return " j security check " ; }


load server flow config for a specific namespace

public static void load flow config ( string namespace , server flow config config ) { assert util not empty ( namespace , " namespace cannot be empty " ) ; / / todo : support namespace - scope server flow config global flow property update value ( config ) ; }


public model and view build response model and view ( final j e e context context , final services manager services manager , final string client id , final string redirect url , final map < string , string > parameters ) { val registered service = o auth 2 0 utils get registered o auth service by client id ( services manager , client id ) ; val response type = o auth 2 0 utils get response mode type ( context ) ; if ( o auth 2 0 utils is response mode type form post ( registered service , response type ) ) { val model = new linked hash map < string , object > ( ) ; model put ( " original url " , redirect url ) ; model put ( " parameters " , parameters ) ; return new model and view ( cas webflow constants view id post response , model ) ; } return new model and view ( new redirect view ( redirect url ) , parameters ) ; }


assign the exclusive buffers to all remote input channels directly for credit - based mode

public void setup channels ( ) throws i o exception { synchronized ( request lock ) { for ( input channel input channel : input channels values ( ) ) { input channel setup ( ) ; } } }


select the content - type header ' s value from the given array : if json exists in the given array , use it ; otherwise use the first one of the array

public string select header content type ( string [ ] content types ) { if ( content types length = = 0 ) return " application / json " ; if ( string util contains ignore case ( content types , " application / json " ) ) return " application / json " ; return content types [ 0 ] ; }


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


get list of constructor names with line numbers any debug mode may be used

public list < string > get constructor line numbers ( ) { list < string > list = new array list < string > ( ) ; if ( prototype = = null ) { return list ; } try { sleigh parser context pos = prototype get parser context ( buf , context ) ; parser walker walker = new parser walker ( pos ) ; walker base state ( ) ; dump symbol line numbers ( list , walker ) ; } catch ( exception e ) { / / ignore } return list ; }


when provided an emoji that is a skin variation of another , this will return the default yellow version this is to aid in search , so using a variation will still find all emojis tagged with the default version if the emoji has no skin variations , this function will return the original emoji

public static @ non null string get canonical representation ( @ non null string emoji ) { string canonical = variation map get ( emoji ) ; return canonical ! = null ? canonical : emoji ; }


public static rest result < string > http delete ( string url , list < string > headers , map < string , string > param values ) { return request ( url , headers , param values , string utils empty , con time out millis , time out millis , " utf - 8 " , http method delete ) ; }


specify the jca work manager to use for bootstrapping the resource adapter

public void set work manager ( work manager work manager ) { this work manager = work manager ; }


fetch database host ( s ) from connection url

protected string fetch database hosts from u r l ( ) { u r l location hosts location = fetch database hosts index range ( ) ; return url substring ( hosts location start index ( ) , hosts location end index ( ) ) ; }


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


is this task only ever going to execute once ?

public boolean is one time task ( ) { return ( this period < 0 ) ; }


default void run ( t configuration , environment environment ) throws exception { / / do nothing }


test changing name and source on existing symbol to same name and source in both latest and my

public void test change symbol name source same in both ( ) throws exception { / / 01002721 : primary global " xxx " mtf initialize ( " notepad merge listing test " , new program modifier listener ( ) { / * ( non - javadoc ) * @ see ghidra framework data program modifier listener # modify latest ( ghidra program database program d b ) * / @ override public void modify latest ( program d b program ) { int tx id = program start transaction ( " modify my program " ) ; boolean commit = false ; try { symbol symbol = get unique symbol ( program , " xxx " ) ; assert equals ( source type user defined , symbol get source ( ) ) ; symbol set name ( " five " , source type analysis ) ; commit = true ; } catch ( exception e ) { assert fail ( e get message ( ) ) ; } finally { program end transaction ( tx id , commit ) ; } } / * ( non - javadoc ) * @ see ghidra framework data program modifier listener # modify private ( ghidra program database program d b ) * / @ override public void modify private ( program d b program ) { int tx id = program start transaction ( " modify my program " ) ; boolean commit = false ; try { symbol symbol = get unique symbol ( program , " xxx " ) ; assert equals ( source type user defined , symbol get source ( ) ) ; symbol set name ( " five " , source type analysis ) ; commit = true ; } catch ( exception e ) { assert fail ( e get message ( ) ) ; } finally { program end transaction ( tx id , commit ) ; } } } ) ; execute merge ( ask user ) ; wait for merge completion ( ) ; symbol s ; s = get unique symbol ( result program , " five " ) ; check symbol ( s , " five " , true ) ; assert equals ( source type analysis , s get source ( ) ) ; }


returns the length of the supplied array

static public int get length ( object array ) { return reflection cache get type ( array get class ( ) ) get array length ( array ) ; }


called for each request with the corresponding { @ link abstract checkpoint stats } instance

protected abstract r handle checkpoint request ( handler request < empty request body , m > request , abstract checkpoint stats checkpoint stats ) throws rest handler exception ;


a main method for testing configuration parsing

public static void main ( string [ ] args ) { try { configuration parser parser = new configuration parser ( args , system get properties ( ) ) ; try { parser parse ( new configuration ( ) ) ; } catch ( parse exception ex ) { ex print stack trace ( ) ; } finally { parser close ( ) ; } } catch ( i o exception ex ) { ex print stack trace ( ) ; } }


test : 1 hash arrays are the same size 2 elements are null expected result : equal

public void test equality 2 ( ) { hash entry [ ] hash entries 1 = new hash entry [ 5 ] ; hash entry [ ] hash entries 2 = new hash entry [ 5 ] ; vec 1 set hash entries ( hash entries 1 ) ; vec 2 set hash entries ( hash entries 2 ) ; assert assert true ( " failed to equate two vectors with identical hash entry instances " , vec 1 equals ( vec 2 ) ) ; }


construct { @ link phased backoff wait strategy } with fallback to { @ link sleeping wait strategy }

public static phased backoff wait strategy with sleep ( long spin timeout , long yield timeout , time unit units ) { return new phased backoff wait strategy ( spin timeout , yield timeout , units , new sleeping wait strategy ( 0 ) ) ; }


the searcher for the shard this { @ linkplain aggregator } is running against used by all { @ linkplain aggregator } s that perform extra collection phases in addition to the one done in { @ link # get leaf collector ( leaf reader context , leaf bucket collector ) } and by to look up extra " background " information about contents of the shard itself

protected final index searcher searcher ( ) { return context searcher ( ) ; }


public void test data node ports ( ) throws exception { name node nn = null ; try { nn = start name node ( ) ; / / start data - node on the same port as name - node configuration conf 2 = new hdfs configuration ( config ) ; conf 2 set ( d f s config keys dfs datanode data dir key , new file ( hdfs dir , " data " ) get path ( ) ) ; conf 2 set ( d f s config keys dfs datanode address key , file system get default uri ( config ) get authority ( ) ) ; conf 2 set ( d f s config keys dfs datanode http address key , this host ) ; boolean started = can start data node ( conf 2 ) ; assert false ( started ) ; / / should fail / / bind http server to the same port as name - node conf 2 set ( d f s config keys dfs datanode address key , this host ) ; conf 2 set ( d f s config keys dfs datanode http address key , config get ( d f s config keys dfs namenode http address key ) ) ; started = can start data node ( conf 2 ) ; assert false ( started ) ; / / should fail / / both ports are different from the name - node ones conf 2 set ( d f s config keys dfs datanode address key , this host ) ; conf 2 set ( d f s config keys dfs datanode http address key , this host ) ; conf 2 set ( d f s config keys dfs datanode ipc address key , this host ) ; started = can start data node ( conf 2 ) ; assert true ( started ) ; / / should start now } finally { stop name node ( nn ) ; } }


return a window definition with the window size based on the given maximum time difference ( inclusive ) between records in the same window and given window grace period reject out - of - order events that arrive after { @ code grace } a window is closed when { @ code stream - time > window - end + grace - period }

public static sliding windows with time difference and grace ( final duration time difference , final duration grace ) throws illegal argument exception { final string msg prefix size = prepare millis check fail msg prefix ( time difference , " time difference " ) ; final long time difference ms = validate millisecond duration ( time difference , msg prefix size ) ; if ( time difference ms < 0 ) { throw new illegal argument exception ( " window time difference must not be negative " ) ; } final string msg prefix grace = prepare millis check fail msg prefix ( grace , " grace " ) ; final long grace ms = validate millisecond duration ( grace , msg prefix grace ) ; if ( grace ms < 0 ) { throw new illegal argument exception ( " window grace period must not be negative " ) ; } return new sliding windows ( time difference ms , grace ms ) ; }


stop the controller for implementations where the controller is an external process this will instruct that external process to exit , thus preventing any subsequent controller operations from working stopping the controller is irreversible ; the only way to restart a controller is to restart the elasticsearch node


public string insn comment string ( dalv insn insn , boolean note indices ) { return branch comment ( insn ) ; }


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


creates the md5 checksum for the given file

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


returns the cardinality of the given field or { @ code null } if there is no cardinality for that field


returns a new { @ code mutable class to instance map } instance backed by a { @ link hash map } using the default initial capacity and load factor

public static < b > mutable class to instance map < b > create ( ) { return new mutable class to instance map < b > ( new hash map < class < ? extends b > , b > ( ) ) ; }


the @ timestamp field will always have been parsed into epoch format , so we just need to know if it has nanosecond resolution or not

public map < string , string > get es date mapping type without format ( ) { return collections singleton map ( file structure utils mapping type setting , need nanosecond precision ( ) ? " date nanos " : " date " ) ; }


public void wait for completion ( ) throws i o exception ;


interface method called when the program changes

public void domain object changed ( domain object changed event ev ) { update ( ev ) ; }


public list < cov exp > get branches ( ) { return branches ; }


replaces the local symbols in to func with the local symbols that are in the from func

private void replace locals ( function to func , function from func , task monitor monitor ) throws cancelled exception { variable [ ] old locals = to func get local variables ( ) ; variable [ ] from locals = from func get local variables ( ) ; if ( arrays equals ( old locals , from locals ) ) { return ; } / / remove all locals in the to func that don ' t have a comparable local in the from func for ( variable local : old locals ) { monitor check canceled ( ) ; variable from var = diff utility get variable ( local , from func ) ; if ( from var = = null ) { to func remove variable ( local ) ; } } for ( variable from local : from locals ) { monitor check canceled ( ) ; replace variable ( from func , from local , to func ) ; } }


sets the items visible in the select box

public void set items ( array < t > new items ) { if ( new items = = null ) throw new illegal argument exception ( " new items cannot be null " ) ; float old pref width = get pref width ( ) ; if ( new items ! = items ) { items clear ( ) ; items add all ( new items ) ; } selection validate ( ) ; select box list list set items ( items ) ; invalidate ( ) ; if ( old pref width ! = get pref width ( ) ) invalidate hierarchy ( ) ; }


returns a { @ linkplain delayable writeable } that stores its contents in serialized form

public abstract serialized < t > as serialized ( writeable reader < t > reader , named writeable registry registry ) ;


create a parallel builder with a database dependency checker using the specified action cache

protected builder with result create builder ( action cache action cache , final int thread count , final boolean keep going ) throws exception { return create builder ( action cache , thread count , keep going , / * evaluation progress receiver = * / null , graph inconsistency receiver throwing ) ; }


< code > map & lt ; string , org apache dubbo common serialize protobuf model phone number & gt ; double map = 9 ; < code >

public builder put all double map ( java util map < string , phone number > values ) { internal get mutable double map ( ) get mutable map ( ) put all ( values ) ; return this ; }


creates a new { @ link default drm session } and acquires it on behalf of the caller ( passing in { @ code event dispatcher } ) if { @ link # session keepalive ms } ! = { @ link c # time unset } then acquires it again to allow the manager to keep it alive ( passing in { @ code event dispatcher = null }

private default drm session create and acquire session ( @ nullable list < scheme data > scheme datas , boolean is placeholder session , @ nullable drm session event listener event dispatcher event dispatcher ) { assertions check not null ( exo media drm ) ; / / placeholder sessions should always play clear samples without keys boolean play clear samples without keys = this play clear samples without keys | is placeholder session ; default drm session session = new default drm session ( uuid , exo media drm , / * provisioning manager = * / provisioning manager impl , reference count listener , scheme datas , mode , play clear samples without keys , is placeholder session , offline license key set id , key request parameters , callback , assertions check not null ( playback looper ) , load error handling policy ) ; / / acquire the session once on behalf of the caller to drm session manager - this is the / / reference ' assigned ' to the caller which they ' re responsible for releasing do this first , / / to ensure that event dispatcher receives all events related to the initial / / acquisition / opening session acquire ( event dispatcher ) ; if ( session keepalive ms ! = c time unset ) { / / acquire the session once more so the manager can keep it alive session acquire ( / * event dispatcher = * / null ) ; } return session ; }


finishing reading the b c file release all resources

public void close ( ) { / / nothing to be done now }


determine the { @ link mime type } of a message from the given message headers

mime type resolve ( @ nullable message headers headers ) throws invalid mime type exception ;


save snapshots and snapshot quota for a snapshottable directory

public static void save snapshots ( i node directory current , data output out ) throws i o exception { directory snapshottable feature sf = current get directory snapshottable feature ( ) ; preconditions check argument ( sf ! = null ) ; / / list of snapshots in snapshots by names read only list < snapshot > snapshots = sf get snapshot list ( ) ; out write int ( snapshots size ( ) ) ; for ( snapshot s : snapshots ) { / / write the snapshot id out write int ( s get id ( ) ) ; } / / snapshot quota out write int ( sf get snapshot quota ( ) ) ; }


indexing operations which entail mapping changes require a blocking request to the master node to update the mapping if the master node is being disrupted or if it cannot commit cluster state changes , it needs to retry within timeout limits this retry logic is implemented in transport master node action and tested by the following master failover scenario

public void test master failover during indexing with mapping changes ( ) throws throwable { logger info ( " - - > start 4 nodes , 3 master , 1 data " ) ; internal cluster ( ) set bootstrap master node index ( 2 ) ; internal cluster ( ) start master only nodes ( 3 , settings empty ) ; string data node = internal cluster ( ) start data only node ( settings empty ) ; logger info ( " - - > wait for all nodes to join the cluster " ) ; ensure stable cluster ( 4 ) ; / / we index data with mapping changes into cluster and have master failover at same time client ( ) admin ( ) indices ( ) prepare create ( " myindex " ) set settings ( settings builder ( ) put ( " index number of shards " , 1 ) put ( " index number of replicas " , 0 ) ) get ( ) ; ensure green ( " myindex " ) ; final cyclic barrier barrier = new cyclic barrier ( 2 ) ; thread indexing thread = new thread ( new runnable ( ) { @ override public void run ( ) { try { barrier await ( ) ; } catch ( interrupted exception e ) { logger warn ( " barrier interrupted " , e ) ; return ; } catch ( broken barrier exception e ) { logger warn ( " broken barrier " , e ) ; return ; } for ( int i = 0 ; i < 10 ; i + + ) { / / index data with mapping changes index response response = client ( data node ) prepare index ( " myindex " ) set source ( " field " + i , " val " ) get ( ) ; assert equals ( doc write response result created , response get result ( ) ) ; } } } ) ; indexing thread set name ( " indexing thread " ) ; indexing thread start ( ) ; barrier await ( ) ; / / interrupt communication between master and other nodes in cluster network disruption partition = isolate master disruption ( network disruption disconnect ) ; internal cluster ( ) set disruption scheme ( partition ) ; logger info ( " - - > disrupting network " ) ; partition start disrupting ( ) ; logger info ( " - - > waiting for new master to be elected " ) ; ensure stable cluster ( 3 , data node ) ; partition stop disrupting ( ) ; logger info ( " - - > waiting to heal " ) ; ensure stable cluster ( 4 ) ; indexing thread join ( ) ; ensure green ( " myindex " ) ; refresh ( ) ; assert that ( client ( ) prepare search ( " myindex " ) get ( ) get hits ( ) get total hits ( ) value , equal to ( 10l ) ) ; }


invokes { @ link # build feed entries ( map , http servlet request , http servlet response ) } to get a list of feed entries

protected final void build feed entries ( map < string , object > model , feed feed , http servlet request request , http servlet response response ) throws exception { list < entry > entries = build feed entries ( model , request , response ) ; feed set entries ( entries ) ; }


public static string fix null ( @ check for null string s ) { return fix null ( s , " " ) ; }


post pet { pet id } : updates a pet in the store with form data

default response entity < void > update pet with form ( @ api param ( value = " id of pet that needs to be updated " , required = true ) @ path variable ( " pet id " ) long pet id , @ api param ( value = " updated name of the pet " ) @ valid @ request part ( value = " name " , required = false ) string name , @ api param ( value = " updated status of the pet " ) @ valid @ request part ( value = " status " , required = false ) string status ) { return new response entity < > ( http status not implemented ) ; }


called when the active playback parameters changed will not be called for { @ link # set playback parameters ( playback parameters ) }

void on playback parameters changed ( playback parameters new playback parameters ) ;


sets a custom legend ' s entries array a null label will start a group this will disable the feature that automatically calculates the legend entries from the datasets call reset custom ( ) to re - enable automatic calculation ( and then notify data set changed ( ) is needed to auto - calculate the legend again )

public void set custom ( legend entry [ ] entries ) { m entries = entries ; m is legend custom = true ; }


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


gets a fast digest for the given path , or { @ code null } if there isn ' t one available or the filesystem doesn ' t support them this digest should be suitable for detecting changes to the file

protected byte [ ] get fast digest ( path path ) throws i o exception { return null ; }


tests that we can edit a tag in latest , delete it in my , and correctly resolve the conflict to keep the deleted version

public void test edit latest delete my keep my ( ) throws exception { mtf initialize ( notepad , new original program modifier listener ( ) { @ override public void modify latest ( program d b program ) throws exception { int transaction i d = program start transaction ( " latest " ) ; try { edit tag name ( program , tag name a , tag name a latest ) ; } finally { program end transaction ( transaction i d , true ) ; } } @ override public void modify private ( program d b program ) throws exception { int transaction i d = program start transaction ( " my " ) ; try { delete tag ( program , tag name a ) ; } finally { program end transaction ( transaction i d , true ) ; } } @ override public void modify original ( program d b program ) throws exception { int transaction i d = program start transaction ( " original " ) ; try { function tag manager tag manager = get tag manager ( program ) ; tag manager create function tag ( tag name a , " " ) ; } finally { program end transaction ( transaction i d , true ) ; } } } ) ; execute merge ( ask user ) ; choose function tag button ( my button , false ) ; wait for merge completion ( ) ; / / get the result program and check that : / / 1 the edited tag is not in result / / 2 the original version is not in result assert true ( ! is tag in program ( tag name a latest , mtf get result program ( ) ) ) ; assert true ( ! is tag in program ( tag name a , mtf get result program ( ) ) ) ; }


releases all threads in the { @ link # waiters } list , and clears the list

private void release waiters ( ) { waiter head ; do { head = waiters ; } while ( ! atomic helper cas waiters ( this , head , waiter tombstone ) ) ; for ( waiter current waiter = head ; current waiter ! = null ; current waiter = current waiter next ) { current waiter unpark ( ) ; } }


gets all the records under the current context ( i e join key )

iterable < row data > get records ( ) throws exception ;


public static int read unsigned int ( byte input in , int zwidth , boolean fill on right ) { int result = 0 ; if ( ! fill on right ) { for ( int i = zwidth ; i > = 0 ; i - - ) { result = ( result > > > 8 ) | ( ( in read byte ( ) & 0xff ) < < 24 ) ; } result > > > = ( 3 - zwidth ) * 8 ; } else { for ( int i = zwidth ; i > = 0 ; i - - ) { result = ( result > > > 8 ) | ( ( in read byte ( ) & 0xff ) < < 24 ) ; } } return result ; }


converts the given label to an output path where double slashes and colons are replaced with single slashes

private static string convert label to path ( string label ) { return label replace ( ' : ' , ' / ' ) substring ( 1 ) ; }


set the current listener for the { @ link g l profiler } to { @ code error listener }

public void set listener ( g l error listener error listener ) { this listener = error listener ; }


validate a all of schema can be deserialized into the expected class

public void test all of schema ( ) throws exception { { string str = " { \ " class name \ " : \ " dog \ " , \ " color \ " : \ " white \ " , \ " breed \ " : \ " siberian husky \ " } " ; / / we should be able to deserialize a dog into a dog dog d = json get context ( null ) read value ( str , dog class ) ; assert not null ( d ) ; assert equals ( " white " , d get color ( ) ) ; } { string str = " { \ " pet type \ " : \ " child cat \ " , \ " name \ " : \ " fluffy \ " , " + " \ " stuff 1 \ " : \ " the value \ " , " + / / additional , undeclared property of type string " \ " stuff 2 \ " : { \ " p 1 \ " : 123 } , " + / / additional , undeclared property of type object " \ " stuff 3 \ " : null , " + / / additional , undeclared property with null value " \ " stuff 4 \ " : [ 12 , \ " abc \ " ] " + / / additional , undeclared property of type array " } " ; grandparent animal o = json get context ( null ) read value ( str , grandparent animal class ) ; assert not null ( o ) ; assert true ( o instanceof parent pet ) ; assert true ( o instanceof child cat ) ; child cat c = ( child cat ) o ; assert equals ( " fluffy " , c get name ( ) ) ; assert not null ( c get additional properties ( ) ) ; assert equals ( 4 , c get additional properties ( ) size ( ) ) ; assert true ( c get additional properties ( ) contains key ( " stuff 1 " ) ) ; assert true ( c get additional properties ( ) contains key ( " stuff 2 " ) ) ; assert true ( c get additional properties ( ) contains key ( " stuff 3 " ) ) ; assert true ( c get additional properties ( ) contains key ( " stuff 4 " ) ) ; assert equals ( " the value " , c get additional properties ( ) get ( " stuff 1 " ) ) ; assert not null ( c get additional properties ( ) get ( " stuff 2 " ) ) ; assert true ( c get additional properties ( ) get ( " stuff 2 " ) instanceof map ) ; assert null ( c get additional properties ( ) get ( " stuff 3 " ) ) ; assert not null ( c get additional properties ( ) get ( " stuff 4 " ) ) ; assert true ( c get additional properties ( ) get ( " stuff 4 " ) instanceof list ) ; } { string str = " { \ " pet type \ " : \ " child cat \ " , \ " name \ " : \ " fluffy \ " } " ; parent pet o = json get context ( null ) read value ( str , parent pet class ) ; assert not null ( o ) ; assert true ( o instanceof child cat ) ; child cat c = ( child cat ) o ; assert equals ( " fluffy " , c get name ( ) ) ; } { / / wrong discriminator value in the payload string str = " { \ " pet type \ " : \ " garbage \ " , \ " name \ " : \ " fluffy \ " } " ; exception exception = assert throws ( json mapping exception class , ( ) - > { json get context ( null ) read value ( str , grandparent animal class ) ; } ) ; assert true ( exception get message ( ) contains ( " could not resolve type id ' garbage ' " ) ) ; } }


creates a list of generic test case descriptions

public static list < description > create generic test case descriptions ( int num descriptions ) { list < description > descriptions = new array list < > ( ) ; for ( int i = 0 ; i < num descriptions ; i + + ) { descriptions add ( description create test description ( test class , " test " + i ) ) ; } return descriptions ; }


adds the remaining values to the specified array

public int array to array ( int array array ) { while ( has next ) array add ( next ( ) ) ; return array ; }


update application ' s blacklist with addition or removal resources

public abstract void update blacklist ( list < string > blacklist additions , list < string > blacklist removals ) ;


get the slice starting at { @ code offset } in the value at { @ code internal position } with { @ code length } bytes

public slice get slice unchecked ( int internal position , int offset , int length ) { int num 1 2 8 integers = get num 1 2 8 integers ( length ) ; return slices wrapped long array ( values , ( internal position + offset ) * 2 , num 1 2 8 integers * 2 ) ; }


specifies the time attribute on which rows are ordered for streaming tables , reference a rowtime or proctime time attribute here to specify the time mode for batch tables , refer to a timestamp or long attribute

public static over window partitioned ordered order by ( expression order by ) { return partition by ( ) order by ( order by ) ; }


bitmap cache get - > background thread hand - off - > multiplex - > bitmap cache - > decode - > branch on separate images - > thumbnail resize and rotate - > thumbnail branch - > local content thumbnail creation - > exif thumbnail creation - > local image resize and rotate - > add meta data producer - > multiplex - > encoded cache - > ( webp transcode ) - > local content uri fetch

private synchronized producer < closeable reference < closeable image > > get local content uri fetch sequence ( ) { if ( m local content uri fetch sequence = = null ) { local content uri fetch producer local content uri fetch producer = m producer factory new local content uri fetch producer ( ) ; thumbnail producer < encoded image > [ ] thumbnail producers = new thumbnail producer [ 2 ] ; thumbnail producers [ 0 ] = m producer factory new local content uri thumbnail fetch producer ( ) ; thumbnail producers [ 1 ] = m producer factory new local exif thumbnail producer ( ) ; m local content uri fetch sequence = new bitmap cache get to local transform sequence ( local content uri fetch producer , thumbnail producers ) ; } return m local content uri fetch sequence ; }


consumes the next token from the json stream and asserts that it is the end of the current object

public void end object ( ) throws i o exception { int p = peeked ; if ( p = = peeked none ) { p = do peek ( ) ; } if ( p = = peeked end object ) { stack size - - ; path names [ stack size ] = null ; / / free the last path name so that it can be garbage collected ! path indices [ stack size - 1 ] + + ; peeked = peeked none ; } else { throw new illegal state exception ( " expected end object but was " + peek ( ) + location string ( ) ) ; } }


returns the { @ link track bundle } whose sample has the earliest file position out of those yet to be consumed , or null if all have been consumed

private static track bundle get next track bundle ( sparse array < track bundle > track bundles ) { @ nullable track bundle next track bundle = null ; long next sample offset = long max value ; int track bundles size = track bundles size ( ) ; for ( int i = 0 ; i < track bundles size ; i + + ) { track bundle track bundle = track bundles value at ( i ) ; if ( ( ! track bundle currently in fragment & & track bundle current sample index = = track bundle moov sample table sample count ) | | ( track bundle currently in fragment & & track bundle current track run index = = track bundle fragment trun count ) ) { / / this track sample table or fragment contains no more runs in the next mdat box } else { long sample offset = track bundle get current sample offset ( ) ; if ( sample offset < next sample offset ) { next track bundle = track bundle ; next sample offset = sample offset ; } } } return next track bundle ; }


create a { @ link metadata aware aspect instance factory } for the supplied aspect type if the aspect type has no per clause , then a { @ link singleton metadata aware aspect instance factory } is returned , otherwise a { @ link prototype aspect instance factory } is returned

private metadata aware aspect instance factory create aspect instance factory ( aspect metadata am , class < ? > aspect class , string aspect name ) { metadata aware aspect instance factory instance factory ; if ( am get aj type ( ) get per clause ( ) get kind ( ) = = per clause kind singleton ) { / / create a shared aspect instance object instance = get singleton aspect instance ( aspect class ) ; instance factory = new singleton metadata aware aspect instance factory ( instance , aspect name ) ; } else { / / create a factory for independent aspect instances instance factory = new simple metadata aware aspect instance factory ( aspect class , aspect name ) ; } return instance factory ; }


returns a { @ code char } matcher functionally equivalent to this one , but which may be faster to query than the original ; your mileage may vary precomputation takes time and is likely to be worthwhile only if the precomputed matcher is queried many thousands of times this method has no effect ( returns { @ code this } ) when called in gwt : it ' s unclear whether a precomputed matcher is faster , but it certainly consumes more memory , which doesn ' t seem like a worthwhile tradeoff in a browser

public char matcher precomputed ( ) { return platform precompute char matcher ( this ) ; }


indicates that the attribute ( like srcs or hdrs ) should be used as an input when calculating compile one dependency

public builder < type > direct compile time input ( ) { return set property flag ( property flag direct compile time input , " direct compile time input " ) ; }


centers the viewport around the specified position ( x - index and y - value ) in the chart centering the viewport outside the bounds of the chart is not possible makes most sense in combination with the set scale minima ( ) method

public void center view port ( final float [ ] transformed pts , final view view ) { matrix save = m center view port matrix buffer ; save reset ( ) ; save set ( m matrix touch ) ; final float x = transformed pts [ 0 ] - offset left ( ) ; final float y = transformed pts [ 1 ] - offset top ( ) ; save post translate ( - x , - y ) ; refresh ( save , view , true ) ; }


runs the bare test sequence , capturing a screenshot if a test fails @ exception throwable if any exception is thrown

public void run bare ( ) throws throwable { if ( ! is capture screen shot on failure ( ) ) { super run bare ( ) ; return ; } set up ( ) ; try { run test ( ) ; } catch ( throwable t ) { if ( selenium ! = null ) { string filename = get name ( ) + " png " ; try { selenium capture screenshot ( filename ) ; system err println ( " saved screenshot " + filename ) ; } catch ( exception e ) { system err println ( " couldn ' t save screenshot " + filename + " : " + e get message ( ) ) ; e print stack trace ( ) ; } throw t ; } } finally { tear down ( ) ; } }


notifies that the node for { @ code sky key } has been evaluated { @ code state } indicates the new state of the node if the value builder threw an error when building this node , then { @ code value supplier get ( ) } evaluates to null

void evaluated ( sky key sky key , @ nullable sky value value , supplier < evaluation success state > evaluation success state , evaluation state state ) ;


determine whether this parser is supposed to fire a { @ link org springframework beans factory parsing bean component definition } event after parsing the bean definition this implementation returns { @ code true } by default ; that is , an event will be fired when a bean definition has been completely parsed override this to return { @ code false } in order to suppress the event

protected boolean should fire events ( ) { return true ; }


draws a rectangle with the bottom left corner at x , y having the given width and height in pixels the portion of the { @ link texture } given by src x , src y and src width , src height are used these coordinates and sizes are given in texels

public void draw ( texture texture , float x , float y , int src x , int src y , int src width , int src height ) ;


@ t c description : @ test step : @ expect result :

public void multiple tenant subscribe ( ) throws exception { string service name = random domain name ( ) ; naming 1 subscribe ( service name , new event listener ( ) { @ override public void on event ( event event ) { instances = ( ( naming event ) event ) get instances ( ) ; } } ) ; naming 1 register instance ( service name , " 11 11 11 11 " , test port , " c 1 " ) ; naming 2 register instance ( service name , " 33 33 33 33 " , test port , " c 1 " ) ; while ( instances size ( ) = = 0 ) { time unit seconds sleep ( 1l ) ; } assert assert equals ( 1 , instances size ( ) ) ; time unit seconds sleep ( 2l ) ; assert assert true ( verify instance list ( instances , naming 1 get all instances ( service name ) ) ) ; }


this method can be used to signal this metric fetcher that the metrics are still in use and should be updated

public void update ( ) { synchronized ( this ) { long current time = system current time millis ( ) ; if ( current time - last update time > update interval ) { last update time = current time ; fetch metrics ( ) ; } } }


returns whether the underlying library is available , loading it if necessary

public static boolean is available ( ) { return loader is available ( ) ; }


connects to the debug server , and starts listening for events

void connect ( server socket server socket , duration timeout ) { long start time millis = system current time millis ( ) ; i o exception exception = null ; while ( system current time millis ( ) - start time millis < timeout to millis ( ) ) { try { client socket = new socket ( ) ; client socket connect ( new inet socket address ( server socket get inet address ( ) , server socket get local port ( ) ) , 100 ) ; read task = read task executor submit ( ( ) - > { while ( true ) { event received ( debug event parse delimited from ( client socket get input stream ( ) ) ) ; } } ) ; return ; } catch ( i o exception e ) { exception = e ; } } throw new runtime exception ( " couldn ' t connect to the debug server " , exception ) ; }


determines the slot sharing group for an operation based on the slot sharing group set by the user and the slot sharing groups of the inputs if the user specifies a group name , this is taken as is if nothing is specified and the input operations all have the same group name then this name is taken otherwise the default group is chosen

private string determine slot sharing group ( string specified group , collection < integer > input ids ) { if ( specified group ! = null ) { return specified group ; } else { string input group = null ; for ( int id : input ids ) { string input group candidate = stream graph get slot sharing group ( id ) ; if ( input group = = null ) { input group = input group candidate ; } else if ( ! input group equals ( input group candidate ) ) { return default slot sharing group ; } } return input group = = null ? default slot sharing group : input group ; } }


converts a big integer to either an i pv 4 or i pv 6 address if the ip is i pv 4 , it must be constrainted to 32 bits , otherwise it is constrained to 128 bits

private static inet address from big integer ( big integer address , boolean is ipv 6 ) { check argument ( address signum ( ) > = 0 , " big integer must be greater than or equal to 0 " ) ; int num bytes = is ipv 6 ? 16 : 4 ; byte [ ] address bytes = address to byte array ( ) ; byte [ ] target copy array = new byte [ num bytes ] ; int src pos = math max ( 0 , address bytes length - num bytes ) ; int copy length = address bytes length - src pos ; int dest pos = num bytes - copy length ; / / check the extra bytes in the big integer are all zero for ( int i = 0 ; i < src pos ; i + + ) { if ( address bytes [ i ] ! = 0x 0 0 ) { throw format illegal argument exception ( " big integer cannot be converted to inet address because it has more than % d " + " bytes : % s " , num bytes , address ) ; } } / / copy the bytes into the least significant positions system arraycopy ( address bytes , src pos , target copy array , dest pos , copy length ) ; try { return inet address get by address ( target copy array ) ; } catch ( unknown host exception impossible ) { throw new assertion error ( impossible ) ; } }


public closeable image decode ( encoded image encoded image , int length , quality info quality info , image decode options options ) { rect region to decode = compute region to decode ( encoded image , options ) ; closeable reference < bitmap > decoded bitmap reference = m platform decoder decode j p e g from encoded image with color space ( encoded image , options bitmap config , region to decode , length , options color space ) ; try { maybe apply transformation ( options bitmap transformation , decoded bitmap reference ) ; return new closeable static bitmap ( decoded bitmap reference , immutable quality info full quality , encoded image get rotation angle ( ) , encoded image get exif orientation ( ) ) ; } finally { closeable reference close safely ( decoded bitmap reference ) ; } }


register a listener that will be called when this model visibility state has changed the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules

public test after bind props view model on visibility state changed ( on model visibility state changed listener < test after bind props view model , test after bind props view > listener ) { on mutation ( ) ; this on model visibility state changed listener epoxy generated model = listener ; return this ; }


adds all resources in the specified skin json file

public void load ( file handle skin file ) { try { get json loader ( skin file ) from json ( skin class , skin file ) ; } catch ( serialization exception ex ) { throw new serialization exception ( " error reading file : " + skin file , ex ) ; } }


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


public state get state ( ) { return state ; }


generate a token vocab file with all the token namestypes for example : id = 7 for = 8 ' for ' = 8 this is independent of the target language ; used by antlr internally

st get token vocab output ( ) { st vocab file s t = new st ( vocab file pattern ) ; map < string , integer > tokens = new linked hash map < string , integer > ( ) ; / / make constants for the token names for ( string t : g token name to type map key set ( ) ) { int token type = g token name to type map get ( t ) ; if ( token type > = token min user token type ) { tokens put ( t , token type ) ; } } vocab file s t add ( " tokens " , tokens ) ; / / now dump the strings map < string , integer > literals = new linked hash map < string , integer > ( ) ; for ( string literal : g string literal to type map key set ( ) ) { int token type = g string literal to type map get ( literal ) ; if ( token type > = token min user token type ) { literals put ( literal , token type ) ; } } vocab file s t add ( " literals " , literals ) ; return vocab file s t ; }


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


public set < string > get photo urls ( ) { return photo urls ; }


test that find containing jar works correctly even if the path has a " + " sign or spaces in it

public void test find containing jar with plus ( ) throws exception { new file ( test dir with special chars ) mkdirs ( ) ; configuration conf = new configuration ( ) ; file system localfs = file system get local ( conf ) ; file util copy ( localfs , new path ( jar relative path ) , localfs , new path ( test dir with special chars , " test jar " ) , false , true , conf ) ; test jar at path ( test dir with special chars + file separator + " test jar " ) ; }


sets cartesian product doesn ' t allow sets that contain null , but we want null to mean " don ' t call the associated cache builder method " - that is , get the default cache builder behavior this method wraps the elements in the input sets ( which may contain null ) as optionals , calls sets cartesian product with those , then transforms the result to unwrap the optionals

private iterable < list < object > > build cartesian product ( set < ? > sets ) { list < set < optional < ? > > > optional sets = lists new array list with expected size ( sets length ) ; for ( set < ? > set : sets ) { set < optional < ? > > optional set = sets new linked hash set ( iterables transform ( set , nullable to optional ) ) ; optional sets add ( optional set ) ; } set < list < optional < ? > > > cartesian product = sets cartesian product ( optional sets ) ; return iterables transform ( cartesian product , new function < list < optional < ? > > , list < object > > ( ) { @ override public list < object > apply ( list < optional < ? > > objs ) { return lists transform ( objs , optional to nullable ) ; } } ) ; }


get the contact filtering data modifying the returned { @ code filter } without calling { @ link # set filter data } can result in unpredictable behaviour

public filter get filter data ( ) { if ( dirty filter ) { jni get filter data ( addr , tmp ) ; filter mask bits = tmp [ 0 ] ; filter category bits = tmp [ 1 ] ; filter group index = tmp [ 2 ] ; dirty filter = false ; } return filter ; }


fills the { @ link byte buf } with zero bytes and releases it

static void zeroout and release ( byte buf buffer ) { zeroout ( buffer ) ; buffer release ( ) ; }


reads a sequence of bytes from this content into the given buffer , starting at the given position

public int get ( byte buffer dst , long position ) throws i o exception { return get ( dst , null , position ) ; }


create a new builder with a { @ linkplain http status # created created } status and a location header set to the given uri

public static body builder created ( uri location ) { return status ( http status created ) location ( location ) ; }


returns the next available extracted data note that it is possible for the extracted data to be empty the last time this method can be called

optional < input stream > next ( ) throws i o exception ;


return the application ' s signature for sha256 value

public static list < string > get app signatures s h a 2 5 6 ( ) { return get app signatures s h a 2 5 6 ( utils get app ( ) get package name ( ) ) ; }


converts a integral value to the corresponding little endian array

private static byte [ ] integer to little endian ( byte [ ] buf , int offset , long value , int num bytes ) { for ( int i = 0 ; i < num bytes ; i + + ) { buf [ i + offset ] = ( byte ) ( ( value & ( 0xff l < < ( i * 8 ) ) ) > > ( i * 8 ) ) ; } return buf ; }


this method is deprecated use get entries ( ) instead

public list < t > get values ( ) { return m entries ; }


private static float valid probability ( float p ) { preconditions check argument ( p > = 0 0f & & p < = 1 0f , " probability out of range 0 to 1 % s " , p ) ; return p ; }


6 : bral 12 - - + ( start 1 w nfctx = 2 @ 12 ) | 10 : nfctx # 3 | ( start 2 ) 12 : cop 3 < - - + ( conflict due to varying context ) 14 : ret test use of non - flow context in disassembly with expected parse error

public void test disassembler inconsistent mid block in program ( ) throws exception { program get program context ( ) set value ( program get register ( " nfctx " ) , addr ( 12 ) , addr ( 12 ) , big integer value of ( 2 ) ) ; program builder add bytes branch ( 6 , 12 ) ; program builder add bytes fallthrough set no flow context ( 10 , 3 ) ; program builder add bytes cop instruction ( 12 ) ; program builder add bytes return ( 14 ) ; address set view dis addrs = disassembler disassemble ( addr ( 6 ) , null ) ; assert equals ( addrset ( range ( 6 , 7 ) , range ( 12 , 15 ) ) , dis addrs ) ; dis addrs = disassembler disassemble ( addr ( 10 ) , null ) ; assert equals ( addrset ( range ( 10 , 11 ) ) , dis addrs ) ; verify instruction presence ( ) ; verify error bookmark ( addr ( 12 ) , " inconsistent instruction prototype " ) ; } / / public void test disassembler multiple conflicts within block ( ) throws exception { / / / / todo : having difficult time coming up with valid test case / / }


convert a j s o n object into a well - formed , element - normal xml string

public static string to string ( object o , string tag name ) throws j s o n exception { string builder b = new string builder ( ) ; int i ; j s o n array ja ; j s o n object jo ; string k ; iterator keys ; int len ; string s ; object v ; if ( o instanceof j s o n object ) { / / emit < tag name > if ( tag name ! = null ) { b append ( ' < ' ) ; b append ( tag name ) ; b append ( ' > ' ) ; } / / loop thru the keys jo = ( j s o n object ) o ; keys = jo keys ( ) ; while ( keys has next ( ) ) { k = keys next ( ) to string ( ) ; v = jo opt ( k ) ; if ( v = = null ) { v = " " ; } if ( v instanceof string ) { s = ( string ) v ; } else { s = null ; } / / emit content in body if ( k equals ( " content " ) ) { if ( v instanceof j s o n array ) { ja = ( j s o n array ) v ; len = ja length ( ) ; for ( i = 0 ; i < len ; i + = 1 ) { if ( i > 0 ) { b append ( ' \ n ' ) ; } b append ( escape ( ja get ( i ) to string ( ) ) ) ; } } else { b append ( escape ( v to string ( ) ) ) ; } / / emit an array of similar keys } else if ( v instanceof j s o n array ) { ja = ( j s o n array ) v ; len = ja length ( ) ; for ( i = 0 ; i < len ; i + = 1 ) { v = ja get ( i ) ; if ( v instanceof j s o n array ) { b append ( ' < ' ) ; b append ( k ) ; b append ( ' > ' ) ; b append ( to string ( v ) ) ; b append ( " < / " ) ; b append ( k ) ; b append ( ' > ' ) ; } else { b append ( to string ( v , k ) ) ; } } } else if ( v equals ( " " ) ) { b append ( ' < ' ) ; b append ( k ) ; b append ( " / > " ) ; / / emit a new tag < k > } else { b append ( to string ( v , k ) ) ; } } if ( tag name ! = null ) { / / emit the < / tagname > close tag b append ( " < / " ) ; b append ( tag name ) ; b append ( ' > ' ) ; } return b to string ( ) ; / / xml does not have good support for arrays if an array appears in / / a place / / where xml is lacking , synthesize an < array > element } else if ( o instanceof j s o n array ) { ja = ( j s o n array ) o ; len = ja length ( ) ; for ( i = 0 ; i < len ; + + i ) { v = ja opt ( i ) ; b append ( to string ( v , ( tag name = = null ) ? " array " : tag name ) ) ; } return b to string ( ) ; } else { s = ( o = = null ) ? " null " : escape ( o to string ( ) ) ; return ( tag name = = null ) ? " \ " " + s + " \ " " : ( s length ( ) = = 0 ) ? " < " + tag name + " / > " : " < " + tag name + " > " + s + " < / " + tag name + " > " ; } }


when invokers in directory changes after a failed request but just before a retry effort , then we should reselect from the latest invokers before retry

public void test invoker destroy and re list ( ) { final url url = url value of ( " test : / / localhost / " + demo class get name ( ) + " ? loadbalance = roundrobin & retries = " + retries ) ; rpc exception exception = new rpc exception ( rpc exception timeout exception ) ; mock invoker < demo > invoker 1 = new mock invoker < demo > ( demo class , url ) ; invoker 1 set exception ( exception ) ; mock invoker < demo > invoker 2 = new mock invoker < demo > ( demo class , url ) ; invoker 2 set exception ( exception ) ; final list < invoker < demo > > invokers = new array list < invoker < demo > > ( ) ; invokers add ( invoker 1 ) ; invokers add ( invoker 2 ) ; callable < object > callable = ( ) - > { / / simulation : all invokers are destroyed for ( invoker < demo > invoker : invokers ) { invoker destroy ( ) ; } invokers clear ( ) ; mock invoker < demo > invoker 3 = new mock invoker < demo > ( demo class , url ) ; invoker 3 set result ( async rpc result new default async result ( null ) ) ; invokers add ( invoker 3 ) ; return null ; } ; invoker 1 set callable ( callable ) ; invoker 2 set callable ( callable ) ; rpc invocation inv = new rpc invocation ( ) ; inv set method name ( " test " ) ; directory < demo > dic = new mock directory < demo > ( url , invokers ) ; failover cluster invoker < demo > clusterinvoker = new failover cluster invoker < demo > ( dic ) ; clusterinvoker invoke ( inv ) ; }


public boolean is big endian ( ) { return big endian ; }


update the results of metadata requests sent

void update metadata results ( task id task id , metadata updates metadata updates ) ;


indicate that source should be returned with every hit , with an " include " andor " exclude " set which can include simple wildcard elements

public top hits aggregation builder fetch source ( @ nullable string include , @ nullable string exclude ) { fetch source ( include = = null ? strings empty array : new string [ ] { include } , exclude = = null ? strings empty array : new string [ ] { exclude } ) ; return this ; }


skips the next token , consuming it this method is intended for use when the json token stream contains unrecognized or unhandled names this throws a { @ link json data exception } if this parser has been configured to { @ linkplain # fail on unknown fail on unknown } names

public abstract void skip name ( ) throws i o exception ;


get the pattern for jar contents to unpack on the tasktracker

public pattern get jar unpack pattern ( ) { return get pattern ( job context jar unpack pattern , unpack jar pattern default ) ; }


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


test that a structure array can ' t be added to the same structure

public void test cyclic dependency problem 2 ( ) { array array = create array ( struct , 3 ) ; try { struct add ( array ) ; assert fail ( " shouldn ' t be able to add a structure array to the same structure " ) ; } catch ( illegal argument exception e ) { / / should get an exception from adding the struct to itself } try { struct insert ( 0 , array ) ; assert fail ( " shouldn ' t be able to insert a structure array into the same structure " ) ; } catch ( illegal argument exception e ) { / / should get an exception from inserting the struct to itself } try { struct replace ( 0 , array , array get length ( ) ) ; assert fail ( " shouldn ' t be able to replace a structure component with an array of the same structure " ) ; } catch ( illegal argument exception e ) { / / should get an exception from replacing the struct to itself } }


read the length of the next serialized { @ code string value }

private static int read string length ( data input view source ) throws i o exception { int len = source read byte ( ) & 0x f f ; if ( len > = high bit ) { int shift = 7 ; int curr ; len = len & 0x 7 f ; while ( ( curr = source read byte ( ) & 0x f f ) > = high bit ) { len | = ( curr & 0x 7 f ) < < shift ; shift + = 7 ; } len | = curr < < shift ; } return len ; }


let prime number be the num buckets , to avoid partition hash and bucket hash congruences

private static int find smaller prime ( int num ) { for ( ; num > 1 ; num - - ) { if ( is prime number ( num ) ) { return num ; } } return num ; }


public output stream stderr ( ) { return stderr ; }


an optional timeout to control how long the graph exploration is allowed to take

public graph explore request builder set timeout ( string timeout ) { request timeout ( timeout ) ; return this ; }


tries to read value of certain column from result set

object get attribute value ( d b d attribute binding attribute ) ;


returns all of the policies that have been configured for simulation and that meet a minimal set of supported characteristics

public set < policy > policies ( ) { return settings policies ( ) stream ( ) map ( name - > factories get ( name to lower case ( us ) ) ) filter ( factory - > factory characteristics ( ) contains all ( characteristics ) ) flat map ( factory - > factory creator ( ) apply ( settings config ( ) ) stream ( ) ) collect ( to set ( ) ) ; }


test correct parsing of ` dist ` parameter , this should create builder with prepost set to same value

public void test parse dist ( ) throws i o exception { x content builder builder = x content factory json builder ( ) ; builder start object ( ) ; builder start object ( span not query builder name ) ; builder field ( " exclude " ) ; span term query ( " description " , " jumped " ) to x content ( builder , null ) ; builder field ( " include " ) ; span near query ( query builders span term query ( " description " , " quick " ) , 1 ) add clause ( query builders span term query ( " description " , " fox " ) ) to x content ( builder , null ) ; builder field ( " dist " , 3 ) ; builder end object ( ) ; builder end object ( ) ; span not query builder query = ( span not query builder ) parse query ( strings to string ( builder ) ) ; assert that ( query pre ( ) , equal to ( 3 ) ) ; assert that ( query post ( ) , equal to ( 3 ) ) ; assert not null ( query include query ( ) ) ; assert not null ( query exclude query ( ) ) ; }


public static void post ( string path , template view route route , template engine engine ) { get instance ( ) post ( path , route , engine ) ; }


de - serializes the given data ( bytes ) which was serialized with the scheme of the indicated version

e deserialize ( int version , byte [ ] serialized ) throws i o exception ;


url based { @ link redirect view } provider which can be used to provide , for example , redirect views with a custom default status code

public void set redirect view provider ( function < string , redirect view > redirect view provider ) { this redirect view provider = redirect view provider ; }


set whether or not we allow fallback to java serialization when no matching codec is found

public builder set allow default codec ( boolean allow default codec ) { this allow default codec = allow default codec ; return this ; }


since this is incapable of returning multiple connection i ds , simply return the first one in most cases , the connection id should be the same for all proxies

public connection id get connection id ( ) { return rpc get connection id for proxy ( proxies [ 0 ] ) ; }


test override disables all service providers through enable = false expectation : all service providers can not be disabled through override

public void test nofity override urls disabled all provider ( ) { registry directory registry directory = get registry directory ( ) ; invocation = new rpc invocation ( ) ; list < url > durls = new array list < url > ( ) ; durls add ( serviceurl set host ( " 10 20 30 140 " ) ) ; durls add ( serviceurl set host ( " 10 20 30 141 " ) ) ; registry directory notify ( durls ) ; durls = new array list < url > ( ) ; durls add ( url value of ( " override : / / 0 0 0 0 ? " + enabled key + " = false " ) ) ; registry directory notify ( durls ) ; list < invoker < ? > > invokers = registry directory list ( invocation ) ; / / all service providers can not be disabled through override assertions assert equals ( 2 , invokers size ( ) ) ; }


load the { @ code application context } for the supplied merged context configuration supports both the { @ link smart context loader } and { @ link context loader } s p is

protected application context load context internal ( merged context configuration merged context configuration ) throws exception { context loader context loader = merged context configuration get context loader ( ) ; assert not null ( context loader , " cannot load an application context with a null ' context loader ' " + " consider annotating your test class with @ context configuration or @ context hierarchy " ) ; application context application context ; if ( context loader instanceof smart context loader ) { smart context loader smart context loader = ( smart context loader ) context loader ; application context = smart context loader load context ( merged context configuration ) ; } else { string [ ] locations = merged context configuration get locations ( ) ; assert not null ( locations , " cannot load an application context with a null ' locations ' array " + " consider annotating your test class with @ context configuration or @ context hierarchy " ) ; application context = context loader load context ( locations ) ; } return application context ; }


void query lottery account funds ( wire transfers bank , scanner scanner ) ;


set the cache operation source for this cache aspect

public void set cache operation source ( j cache operation source cache operation source ) { assert not null ( cache operation source , " j cache operation source must not be null " ) ; this cache operation source = cache operation source ; }


create streaming calculation of the given metrics name this methods is synchronized due to heavy implementation including creating dynamic class don ' t use this in concurrency runtime

public synchronized < t > boolean create ( string metrics name , string function name , scope type type ) throws illegal argument exception { final class < ? extends meter function > meter function = function register get ( function name ) ; if ( meter function = = null ) { throw new illegal argument exception ( " function " + function name + " can ' t be found " ) ; } type acceptance = null ; for ( final type generic interface : meter function get generic interfaces ( ) ) { if ( generic interface instanceof parameterized type ) { parameterized type parameterized type = ( parameterized type ) generic interface ; if ( parameterized type get raw type ( ) get type name ( ) equals ( acceptable value class get name ( ) ) ) { type [ ] arguments = parameterized type get actual type arguments ( ) ; acceptance = arguments [ 0 ] ; break ; } } } try { return create ( metrics name , function name , type , class for name ( objects require non null ( acceptance ) get type name ( ) ) ) ; } catch ( class not found exception e ) { throw new illegal argument exception ( e ) ; } }


private static boolean is setsid supported ( ) { if ( shell windows ) { return false ; } shell command executor shexec = null ; boolean setsid supported = true ; try { string [ ] args = { " setsid " , " bash " , " - c " , " echo $ $ " } ; shexec = new shell command executor ( args ) ; shexec execute ( ) ; } catch ( i o exception ioe ) { log debug ( " setsid is not available on this machine so not using it " ) ; setsid supported = false ; } catch ( security exception se ) { log debug ( " setsid is not allowed to run by the jvm " + " security manager so not using it " ) ; setsid supported = false ; } catch ( error err ) { if ( err get message ( ) ! = null & & err get message ( ) contains ( " posix spawn is not " + " a supported process launch mechanism " ) & & ( shell freebsd | | shell mac ) ) { / / hadoop - 11924 : this is a workaround to avoid failure of class init / / by jdk issue on tr locale ( jdk - 8047340 ) log info ( " avoiding jdk - 8047340 on bsd - based systems " , err ) ; setsid supported = false ; } } finally { / / handle the exit code if ( log is debug enabled ( ) ) { log debug ( " setsid exited with exit code " + ( shexec ! = null ? shexec get exit code ( ) : " ( null executor ) " ) ) ; } } return setsid supported ; }


creates a new blocking - style stub that supports unary and streaming output calls on the service

public static dynamic service blocking stub new blocking stub ( io grpc channel channel ) { io grpc stub abstract stub stub factory < dynamic service blocking stub > factory = new io grpc stub abstract stub stub factory < dynamic service blocking stub > ( ) { @ java lang override public dynamic service blocking stub new stub ( io grpc channel channel , io grpc call options call options ) { return new dynamic service blocking stub ( channel , call options ) ; } } ; return dynamic service blocking stub new stub ( factory , channel ) ; }


this supplier is used for all the field types that should be aggregated as bytesstrings , including those that need global ordinals

private static terms aggregator supplier bytes supplier ( ) { return new terms aggregator supplier ( ) { @ override public aggregator build ( string name , aggregator factories factories , values source values source , bucket order order , doc value format format , terms aggregator bucket count thresholds bucket count thresholds , include exclude include exclude , string execution hint , aggregation context context , aggregator parent , sub agg collection mode sub agg collect mode , boolean show term doc count error , cardinality upper bound cardinality , map < string , object > metadata ) throws i o exception { execution mode execution = null ; if ( execution hint ! = null ) { execution = execution mode from string ( execution hint ) ; } / / in some cases , using ordinals is just not supported : override it if ( values source instanceof values source bytes with ordinals = = false ) { execution = execution mode map ; } if ( execution = = null ) { execution = execution mode global ordinals ; } final long max ord = execution = = execution mode global ordinals ? get max ord ( values source , context searcher ( ) ) : - 1 ; if ( sub agg collect mode = = null ) { sub agg collect mode = pick sub agg colect mode ( factories , bucket count thresholds get shard size ( ) , max ord ) ; } if ( ( include exclude ! = null ) & & ( include exclude is regex based ( ) ) & & format ! = doc value format raw ) { / / todo this exception message is not really accurate for the string case it ' s really disallowing regex + formatter throw new aggregation execution exception ( " aggregation [ " + name + " ] cannot support regular expression style " + " include / exclude settings as they can only be applied to string fields use an array of values for " + " include / exclude clauses " ) ; } / / todo : [ zach ] we might want refactor and remove execution mode # create ( ) , moving that logic outside the enum return execution create ( name , factories , values source , order , format , bucket count thresholds , include exclude , context , parent , sub agg collect mode , show term doc count error , cardinality , metadata ) ; } } ; }


public void put counters ( map < string , long > counters ) { this counters map = counters ; }


decommission or perform maintenance for data nodes and wait for them to reach the expected state

protected datanode info take node outof service ( int nn index , string datanode uuid , long maintenance expiration in m s , array list < datanode info > decommissioned nodes , admin states wait for state ) throws i o exception { return take node outof service ( nn index , datanode uuid , maintenance expiration in m s , decommissioned nodes , null , wait for state ) ; }


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


sets the horizontal text alignment of messages shown in the task dialog the default is { @ link swing constants # center } valid values are { @ link swing constants } leading , center and trailing

public task builder set status text alignment ( int alignment ) { boolean is valid = collection utils is one of ( alignment , leading , center , trailing ) ; system utilities assert true ( is valid , " illegal alignment argument : " + alignment ) ; this status text alignment = alignment ; return this ; }


protected void prepare ( configuration conf , int num data units , int num parity units , int [ ] erased data indexes , int [ ] erased parity indexes ) { prepare ( conf , num data units , num parity units , erased data indexes , erased parity indexes , false ) ; }


equivalent to { @ link java util service loader # load } but without requiring java 6 android 2 3 ( gingerbread )

public < t > t load impl ( class < t > service ) { class loader loader = thread current thread ( ) get context class loader ( ) ; if ( loader = = null ) { loader = class loader get system class loader ( ) ; } enumeration < url > resources ; try { resources = loader get resources ( " mockito - extensions / " + service get name ( ) ) ; } catch ( i o exception e ) { throw new illegal state exception ( " failed to load " + service , e ) ; } try { string class or alias = new plugin finder ( plugin switch ) find plugin class ( iterables to iterable ( resources ) ) ; if ( class or alias ! = null ) { if ( class or alias equals ( alias ) ) { class or alias = plugins get default plugin class ( alias ) ; } class < ? > plugin class = loader load class ( class or alias ) ; object plugin = plugin class get declared constructor ( ) new instance ( ) ; return service cast ( plugin ) ; } return null ; } catch ( exception e ) { throw new illegal state exception ( " failed to load " + service + " implementation declared in " + resources , e ) ; } }


sets whether to enable the experimental feature that keeps and flushes the { @ link android media audio track } when a seek occurs , as opposed to releasing and reinitialising off by default this method is experimental , and will be renamed or removed in a future release

public void experimental set enable keep audio track on seek ( boolean enable keep audio track on seek ) { this experimental keep audio track on seek = enable keep audio track on seek ; }


creates a { @ link runnable } that invokes the given listener with { @ code null } after the given runnable has executed

public static < t > action runnable < t > run ( action listener < t > listener , checked runnable < exception > runnable ) { return new action runnable < > ( listener ) { @ override protected void do run ( ) throws exception { runnable run ( ) ; listener on response ( null ) ; } } ; }


starts playback of the item at the given index

private void set current item ( int item index ) { maybe set current item and notify ( item index ) ; if ( current player get current timeline ( ) get window count ( ) ! = media queue size ( ) ) { / / this only happens with the cast player the receiver app in the cast device clears the / / timeline when the last item of the timeline has been played to end current player set media items ( media queue , item index , c time unset ) ; } else { current player seek to ( item index , c time unset ) ; } current player set play when ready ( true ) ; }


remove any memory requirement that is stored for the specified data frame analytics job it doesn ' t matter if this method is called for a job that doesn ' t have a stored memory requirement

public void remove data frame analytics job ( string id ) { memory requirement by data frame analytics job remove ( id ) ; }


to test enum parameters to test enum parameters

public void test enum parameters test ( ) { list < string > enum header string array = null ; string enum header string = null ; list < string > enum query string array = null ; string enum query string = null ; integer enum query integer = null ; double enum query double = null ; list < string > enum form string array = null ; string enum form string = null ; / / api test enum parameters ( enum header string array , enum header string , enum query string array , enum query string , enum query integer , enum query double , enum form string array , enum form string ) ; / / todo : test validations }


compares a { @ link producer record } with the provided key and value and throws an { @ link assertion error } if the { @ code producer record } ' s key or value is not equal to the expected key or value

public static < k , v > void compare key value ( final producer record < k , v > record , final k expected key , final v expected value ) throws assertion error { objects require non null ( record ) ; final k record key = record key ( ) ; final v record value = record value ( ) ; final assertion error error = new assertion error ( " expected < " + expected key + " , " + expected value + " > " + " but was < " + record key + " , " + record value + " > " ) ; if ( record key ! = null ) { if ( ! record key equals ( expected key ) ) { throw error ; } } else if ( expected key ! = null ) { throw error ; } if ( record value ! = null ) { if ( ! record value equals ( expected value ) ) { throw error ; } } else if ( expected value ! = null ) { throw error ; } }


creates a new builder for the given server host , port and cronet engine

public static cronet channel builder for address ( string host , int port , cronet engine cronet engine ) { preconditions check not null ( cronet engine , " cronet engine " ) ; return new cronet channel builder ( host , port , cronet engine ) ; }


for the given index metadata , register ( index a document ) that the index has been deleted by ilm using the { @ link i l m history store }

void register delete operation ( index metadata metadata before deletion ) { if ( metadata before deletion = = null ) { throw new illegal state exception ( " cannot register deletion of an index that did not previously exist " ) ; } long origination = calculate origination millis ( metadata before deletion ) ; ilm history store put async ( i l m history item success ( metadata before deletion get index ( ) get name ( ) , lifecycle settings lifecycle name setting get ( metadata before deletion get settings ( ) ) , now supplier get as long ( ) , origination = = null ? null : ( now supplier get as long ( ) - origination ) , lifecycle execution state builder ( lifecycle execution state from index metadata ( metadata before deletion ) ) / / register that the delete phase is now " complete " set step ( phase complete step name ) build ( ) ) ) ; }


returns the output base directory associated with this blaze server process this is the base directory for shared blaze state as well as tool and strategy specific subdirectories

public path get output base ( ) { return get directories ( ) get output base ( ) ; }


public string get string prop ( ) { return string prop or else ( null ) ; }


test the audit log format for failure events with the various parameters

private void test failure log format ( boolean check i p ) { test failure log format helper ( check i p , null , null , null ) ; test failure log format helper ( check i p , appid , null , null ) ; test failure log format helper ( check i p , null , null , containerid ) ; test failure log format helper ( check i p , null , attemptid , null ) ; test failure log format helper ( check i p , appid , attemptid , null ) ; test failure log format helper ( check i p , appid , null , containerid ) ; test failure log format helper ( check i p , null , attemptid , containerid ) ; test failure log format helper ( check i p , appid , attemptid , containerid ) ; test failure log format helper ( check i p , appid , attemptid , containerid , new caller context builder ( null ) set signature ( null ) build ( ) , resource ) ; test failure log format helper ( check i p , appid , attemptid , containerid , new caller context builder ( caller context ) set signature ( null ) build ( ) , resource ) ; test failure log format helper ( check i p , appid , attemptid , containerid , new caller context builder ( null ) set signature ( caller signature ) build ( ) , resource ) ; test failure log format helper ( check i p , appid , attemptid , containerid , new caller context builder ( caller context ) set signature ( caller signature ) build ( ) , resource ) ; test failure log format helper ( check i p , appid , attemptid , containerid , new caller context builder ( caller context ) set signature ( caller signature ) build ( ) , resource , queue , null , null ) ; test failure log format helper ( check i p , appid , attemptid , containerid , new caller context builder ( caller context ) set signature ( caller signature ) build ( ) , resource , queue , partition , null ) ; r m audit logger args builder args = new r m audit logger args builder ( ) append ( keys queuename , queue ) append ( keys recursive , " true " ) ; test failure log format helper ( check i p , null , null , null , null , null , null , null , args ) ; }


creates only an inferior relation , used for special distinguishing parent relationships with common functions

public void create inferior relation ( function record superior function , function record inferior function ) throws i o exception { long inferior key = fid d b utils generate inferior full hash smash ( superior function , inferior function ) ; d b record inferior record = schema create record ( inferior key ) ; inferior table put record ( inferior record ) ; }


assert there is arecord in the store , then return it

private path metadata verify record ( metadata store ms , string path ) throws i o exception { final path metadata md = lookup ( ms , path ) ; assertions assert that ( md ) described as ( " metastore entry for % s " , path ) is not null ( ) ; return md ; }


sets the { @ link clock } that will be used by the player should only be set for testing purposes

public builder set clock ( clock clock ) { assertions check state ( ! build called ) ; this clock = clock ; return this ; }


turns a path ( relative or otherwise ) into an s3 key

public string path to key ( path path ) { if ( ! path is absolute ( ) ) { path = new path ( working dir , path ) ; } if ( path to uri ( ) get scheme ( ) ! = null & & path to uri ( ) get path ( ) is empty ( ) ) { return " " ; } return path to uri ( ) get path ( ) substring ( 1 ) ; }


this method is executed once per superstep after the vertex update function has been invoked for each vertex

public void post superstep ( ) throws exception { }


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


set the value of the ' { @ code disabled } ' attribute may be a runtime expression

public void set disabled ( boolean disabled ) { this disabled = disabled ; }


returns a nonempty contiguous set containing all { @ code int } values from { @ code lower } ( inclusive ) to { @ code upper } ( inclusive ) ( these are the same values contained in { @ code range closed ( lower , upper ) } )

public static contiguous set < integer > closed ( int lower , int upper ) { return create ( range closed ( lower , upper ) , discrete domain integers ( ) ) ; }


export the property with an incrementing numeric suffix

string export repeated property ( string name , string value ) ;


return the rating threshold above which ratings are considered to be " relevant " for this metric defaults to 1

public int get relevant rating threshold ( ) { return relevant rating threshold ; }


adds display image task to execution pool image will be set to image aware when it ' s turn < br > < b > note : < b > { @ link # init ( image loader configuration ) } method must be called before this method call

public void display image ( string uri , image aware image aware , display image options options ) { display image ( uri , image aware , options , null , null ) ; }


protected void cleanup registry ( ) { if ( this registry client ! = null ) { this registry client clean all applications ( ) ; } }


returns true if this method is called during a layout state calculation and the layout state reference hasn ' t been nullified

boolean has layout state ( ) { return m layout state context ! = null & & m layout state context get layout state ( ) ! = null ; }


public int action start ( string app name ) throws i o exception , yarn exception { int result = exit success ; try { service service = new service ( ) ; service set name ( app name ) ; service set state ( service state started ) ; string buffer = json ser deser to json ( service ) ; client response response = get api client ( get service path ( app name ) ) put ( client response class , buffer ) ; result = process response ( response ) ; } catch ( exception e ) { log error ( " fail to start application : " , e ) ; result = exit exception thrown ; } return result ; }


collects all of the directories that need to be monitored for the provided { @ link s s l configuration } instances and ensures that they are being watched for changes

private static void start watching ( environment environment , consumer < s s l configuration > reload consumer , resource watcher service resource watcher service , collection < s s l configuration > ssl configurations ) { map < path , list < s s l configuration > > path to configurations map = new hash map < > ( ) ; for ( s s l configuration ssl configuration : ssl configurations ) { for ( path directory : directories to monitor ( ssl configuration files to monitor ( environment ) ) ) { path to configurations map compute ( directory , ( path , list ) - > { if ( list = = null ) { list = new array list < > ( ) ; } list add ( ssl configuration ) ; return list ; } ) ; } } for ( entry < path , list < s s l configuration > > entry : path to configurations map entry set ( ) ) { change listener change listener = new change listener ( environment , list copy of ( entry get value ( ) ) , reload consumer ) ; file watcher file watcher = new file watcher ( entry get key ( ) ) ; file watcher add listener ( change listener ) ; try { resource watcher service add ( file watcher , frequency high ) ; } catch ( i o exception e ) { logger error ( " failed to start watching directory [ { } ] for ssl configurations [ { } ] " , entry get key ( ) , ssl configurations ) ; } } }


test init a queue configuration , children ' s capacity for a given label doesn ' t equals to 100 % this expect illegal argument exception thrown

public void test queue parsing fail when sum of children non labeled capacity not 1 0 0 percent ( ) throws i o exception { node label manager add to cluser node labels with default exclusivity ( immutable set of ( " red " , " blue " ) ) ; yarn configuration conf = new yarn configuration ( ) ; capacity scheduler configuration cs conf = new capacity scheduler configuration ( conf ) ; setup queue configuration ( cs conf ) ; cs conf set capacity ( capacity scheduler configuration root + " c c 2 " , 5 ) ; capacity scheduler capacity scheduler = new capacity scheduler ( ) ; r m context impl rm context = new r m context impl ( null , null , null , null , null , null , new r m container token secret manager ( cs conf ) , new n m token secret manager in r m ( cs conf ) , new client to a m token secret manager in r m ( ) , null ) ; rm context set node label manager ( node label manager ) ; capacity scheduler set conf ( cs conf ) ; capacity scheduler set r m context ( rm context ) ; capacity scheduler init ( cs conf ) ; capacity scheduler start ( ) ; service operations stop quietly ( capacity scheduler ) ; }


void handle e o d ( encoder context context , string builder buffer ) { int unwritten = ( buffer length ( ) / 3 ) * 2 ; int rest = buffer length ( ) % 3 ; int cur codeword count = context get codeword count ( ) + unwritten ; context update symbol info ( cur codeword count ) ; int available = context get symbol info ( ) get data capacity ( ) - cur codeword count ; if ( rest = = 2 ) { buffer append ( ' \ 0 ' ) ; / / shift 1 while ( buffer length ( ) > = 3 ) { write next triplet ( context , buffer ) ; } if ( context has more characters ( ) ) { context write codeword ( high level encoder c40 unlatch ) ; } } else if ( available = = 1 & & rest = = 1 ) { while ( buffer length ( ) > = 3 ) { write next triplet ( context , buffer ) ; } if ( context has more characters ( ) ) { context write codeword ( high level encoder c40 unlatch ) ; } / / else no unlatch context pos - - ; } else if ( rest = = 0 ) { while ( buffer length ( ) > = 3 ) { write next triplet ( context , buffer ) ; } if ( available > 0 | | context has more characters ( ) ) { context write codeword ( high level encoder c40 unlatch ) ; } } else { throw new illegal state exception ( " unexpected case please report ! " ) ; } context signal encoder change ( high level encoder ascii encodation ) ; }


test serialization of outer string types

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


deprecated , use { @ link # add drag ( drag edge , view ) }

public void set drag edges ( drag edge m drag edges ) { clear drag edge ( ) ; set drag edges ( arrays as list ( m drag edges ) ) ; }


override this method to configure " default " servlet handling

protected void configure default servlet handling ( default servlet handler configurer configurer ) { }


returns the data flavors for the types of data that this transferable supports , based upon the given selection

public data flavor [ ] get transfer data flavors ( ) { return transfer handler get supported data flavors ( selected data ) ; }


timeout callback might remain in the timer scheduling queue for some time and it might hold the pointers to other objects as a result it ' s possible to run out of memory if a large number of tasks are executed

private void run and clean ( runnable run ) { try { run run ( ) ; } finally { runnable = null ; timeout future = null ; } }


to display the accumulator for the ad position

public final int at ad pos ( final int pos ) { final int take int = ( int ) math floor ( ( pos + 1 ) / adfrequency ) ; log d ( " at ad pos e 2 " , take int + " " ) ; return take int ; }


notifies the tracker of a non - fatal error in the current playback

public void on non fatal error ( event time event time , exception error ) { non fatal error count + + ; if ( keep history ) { non fatal error history add ( new event time and exception ( event time , error ) ) ; } }


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


in { @ link compressor stream # close ( ) } , if { @ link compressor stream # finish ( ) } throws an i o e xception , output stream object was not getting closed

public void test close ( ) { test compressor stream test compressor stream = new test compressor stream ( ) ; try { test compressor stream close ( ) ; } catch ( i o exception e ) { system out println ( " expected i o exception " ) ; } assert assert true ( " closed shoud be true " , ( ( compressor stream ) test compressor stream ) closed ) ; / / cleanup after test case file delete ( ) ; }


returns a json adapter equal to this json adapter , but with support for reading and writing nulls

public final json adapter < t > null safe ( ) { if ( this instanceof null safe json adapter ) { return this ; } return new null safe json adapter < > ( this ) ; }


adds a standard border with the title that corresponds to the given key in the gui resources

private void add border ( j component component , string title key ) { border old border = component get border ( ) ; border new border = border factory create titled border ( border , msg ( title key ) ) ; component set border ( old border = = null ? new border : new compound border ( new border , old border ) ) ; }


returns an instance that is just like this one , except that the register list is replaced by the given one , and its address is reset

public abstract dalv insn with registers ( register spec list registers ) ;


write the object to the byte stream , handling text as a special case

private void write object ( object o ) throws i o exception { if ( o instanceof text ) { text to = ( text ) o ; out write ( to get bytes ( ) , 0 , to get length ( ) ) ; } else { out write ( o to string ( ) get bytes ( standard charsets utf 8 ) ) ; } }


returns the system name which is required by the toolchain to run

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


public void test intercept future not an exception 2 ( ) throws throwable { completable future < string > future = new completable future < > ( ) ; future complete exceptionally ( new error ( " oops " ) ) ; verify cause ( error class , intercept future ( execution exception class , " " , future ) ) ; }


update storage type quota of specified mount table

private boolean update storage type quota ( string mount , long [ ] type quota ) throws i o exception { / / get existing entry mount table manager mount table = client get mount table manager ( ) ; get mount table entries request get request = get mount table entries request new instance ( mount ) ; get mount table entries response get response = mount table get mount table entries ( get request ) ; list < mount table > results = get response get entries ( ) ; mount table existing entry = null ; for ( mount table result : results ) { if ( mount equals ( result get source path ( ) ) ) { existing entry = result ; break ; } } if ( existing entry = = null ) { throw new i o exception ( mount + " doesn ' t exist in mount table " ) ; } else { final router quota usage quota usage = existing entry get quota ( ) ; long [ ] type count = new long [ storage type values ( ) length ] ; each by storage type ( t - > type count [ t ordinal ( ) ] = quota usage get type quota ( t ) ) ; / / if all storage type quota were reset , clear the storage type quota if ( and by storage type ( t - > type quota [ t ordinal ( ) ] = = hdfs constants quota reset ) ) { each by storage type ( t - > type count [ t ordinal ( ) ] = router quota usage quota usage count default ) ; } else { / / if ns quota or ss quota was unset , use the value in mount table each by storage type ( t - > { if ( type quota [ t ordinal ( ) ] = = hdfs constants quota dont set ) { type quota [ t ordinal ( ) ] = quota usage get type quota ( t ) ; } } ) ; } router quota usage updated quota = new router quota usage builder ( ) type quota ( type quota ) type consumed ( type count ) build ( ) ; existing entry set quota ( updated quota ) ; } update mount table entry request update request = update mount table entry request new instance ( existing entry ) ; update mount table entry response update response = mount table update mount table entry ( update request ) ; return update response get status ( ) ; }


public void test bindings in f s config ( ) throws throwable { task conf ref unset ( fs s3a committer name ) ; filesystem conf ref set ( fs s3a committer name , committer name file ) ; assert factory creates expected committer ( file output committer class ) ; for ( object [ ] binding : bindings ) { task conf ref set ( fs s3a committer name , ( string ) binding [ 0 ] ) ; assert factory creates expected committer ( ( class ) binding [ 1 ] ) ; } }


sets the minimum width that the axis should take ( in dp )

public void set min width ( float min width ) { m min width = min width ; }


the { @ link process instance history log } will contain the { @ link historic variable update } instances

process instance history log query include variable updates ( ) ;


converts a command string into a list of arguments

static linked list < string > get args ( string cmd ) { return new linked list < string > ( arrays as list ( cmd split ( " " ) ) ) ; }


public void on resume ( ) { if ( surface view instanceof g l surface view ) { ( ( g l surface view ) surface view ) on resume ( ) ; } else if ( surface view instanceof g l texture view ) { ( ( g l texture view ) surface view ) on resume ( ) ; } }


returns the source of the wrapped { @ link cronet engine }

public int get cronet engine source ( ) { return cronet engine source ; }