add a new text field to this linker links the given field with the others present in this linker , if any { @ code exp } is a regular expression that dictates where the given field ends , and the next field begins when { @ code exp } matches a part of the text in { @ code field } , the text is split and re - flowed so that the second part is removed into the next linked field the separator is omitted from both fields the packing of the fields - - and surrounding labels - - ought to imply that the separator is still present , because { @ link # get text ( ) } or and { @ link # get text before cursor ( j text field ) } insert { @ code sep } between the fields any number of fields may be added in this fashion , but the last field - - having no associated pattern or separator - - must be added using { @ link # link last field ( j text field ) } thus , before linking is actually activated , at least one field must be present to be meaningful , at least two fields should be linked note : { @ code exp } must match { @ code sep }

public void link field ( j text field field , string exp , string sep ) { pattern pat = pattern compile ( exp ) ; link field ( field , pat , sep ) ; }


{ @ code true } to handle all requests , where uri path component starts from { @ link web socket server protocol config # websocket path ( ) } , { @ code false } for exact match ( default )

public builder check starts with ( boolean check starts with ) { this check starts with = check starts with ; return this ; }


invert a logical right shift of { @ code n } positions , that is shift left this is different from a normal shift left , in that it inserts unknowns at the right the normal left shift inserts zeros additionally , if any ones would fall off the left , the inversion is undefined

public masked long inv shift right logical ( masked long n ) throws solver exception { if ( ! n is fully defined ( ) ) { throw new unsupported operation exception ( " cannot left shift by an unknown amount " ) ; } return inv shift right logical ( n long value ( ) ) ; }


verify that the configuration gets passed as environment variables to the fencer

public void test conf as environment ( ) { if ( ! shell windows ) { fencer try fence ( test target , " echo $ in fencing tests " ) ; mockito verify ( shell command fencer log ) info ( mockito ends with ( " echo $ in ing tests : yessir " ) ) ; } else { fencer try fence ( test target , " echo % in fencing tests % " ) ; mockito verify ( shell command fencer log ) info ( mockito ends with ( " echo % in ng tests % : yessir " ) ) ; } }


create an instance with default behavior which uses { @ code random } to control variance and failure calculation

public static network behavior create ( random random ) { if ( random = = null ) throw new null pointer exception ( " random = = null " ) ; return new network behavior ( random ) ; }


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


returns the primary viewer of the graph ( as opposed to the satellite viewer ) the viewer returned is responsible for maintaining view information for a given graph

public graph viewer < v , e > get primary graph viewer ( ) { if ( graph component = = null ) { return null ; } return graph component get primary viewer ( ) ; }


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

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


returns the total number of stripes in this instance


public void unselected choice states ( ) { touch listener unselected choice states ( ) ; }


undo the quoting done in { @ link com sun jndi dns resource record # decode txt }

static string unquote ( string txt record ) { string builder sb = new string builder ( txt record length ( ) ) ; boolean inquote = false ; for ( int i = 0 ; i < txt record length ( ) ; i + + ) { char c = txt record char at ( i ) ; if ( ! inquote ) { if ( c = = ' ' ) { continue ; } else if ( c = = ' " ' ) { inquote = true ; continue ; } } else { if ( c = = ' " ' ) { inquote = false ; continue ; } else if ( c = = ' \ \ ' ) { c = txt record char at ( + + i ) ; assert c = = ' " ' | | c = = ' \ \ ' ; } } sb append ( c ) ; } return sb to string ( ) ; }


private int force bootstrap ( int i ) throws exception { return bootstrap standby run ( new string [ ] { " - force " } , cluster get configuration ( i ) ) ; }


protected object get target bean ( ) { assert not null ( this application context , " application context must no be null " ) ; return this application context get bean ( this bean name ) ; }


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

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


public int hash code ( ) { int hash = type hash code ( ) ; hash = ( hash * 31 ) + elements hash code ( ) ; hash = ( hash * 31 ) + visibility hash code ( ) ; return hash ; }


helper method to describe lists of sets of things

private static < t > void describe ( string builder result , immutable list < immutable set < t > > list of sets , function < t , string > describe one ) { joiner joiner = joiner on ( " , " ) ; for ( immutable set < t > ids : list of sets ) { if ( result length ( ) > 0 ) { result append ( " or " ) ; } result append ( ( ids size ( ) > 1 ) ? " [ " : " " ) ; joiner append to ( result , ids stream ( ) map ( describe one ) iterator ( ) ) ; result append ( ( ids size ( ) > 1 ) ? " ] " : " " ) ; } }


public model api response upload file with required file ( @ path param ( " pet id " ) long pet id , @ multipart ( value = " required file " ) attachment required file detail , @ multipart ( value = " additional metadata " , required = false ) string additional metadata ) ;


supply the binding information this implementation returns a fixed ensemble bonded to the quorum supplied by { @ link # build connection string ( ) }

public binding information supply binding information ( ) { binding information binding = new binding information ( ) ; string connect string = build connection string ( ) ; binding ensemble provider = new fixed ensemble provider ( connect string ) ; binding description = " fixed zk quorum \ " " + connect string + " \ " " ; return binding ; }


public inet socket address get remote address ( ) { return remote address ; }


test for b 6 2 4 5 6 8 4 9 after desugar , the method { @ code lambda $ mult $ 0 } should still be in the class

public void test call method with lambda naming convention ( ) throws no such method exception , invocation target exception , illegal access exception { method method = lambda class get declared method ( " lambda $ mult $ 0 " ) ; object value = method invoke ( null ) ; assert that ( value ) is instance of ( integer class ) ; assert that ( ( integer ) value ) is equal to ( 0 ) ; }


returns the default operator for the query

public operator default operator ( ) { return this default operator ; }


updates a pet in the store with form data

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


gets an integer value that has bits set as flags indicating the types of differences that exist between the two memory blocks

private int get diff flags ( ) { if ( block 1 = = null ) { if ( block 2 = = null ) { return 0 ; } return all ; } if ( block 2 = = null ) { return all ; } int flags = 0 ; if ( ! block 1 get name ( ) equals ( block 2 get name ( ) ) ) { flags | = name ; } if ( ! block 1 get start ( ) equals ( block 2 get start ( ) ) ) { flags | = start address ; } if ( ! block 1 get end ( ) equals ( block 2 get end ( ) ) ) { flags | = end address ; } if ( block 1 get size ( ) ! = block 2 get size ( ) ) { flags | = size ; } if ( block 1 is read ( ) ! = block 2 is read ( ) ) { flags | = read ; } if ( block 1 is write ( ) ! = block 2 is write ( ) ) { flags | = write ; } if ( block 1 is execute ( ) ! = block 2 is execute ( ) ) { flags | = execute ; } if ( block 1 is volatile ( ) ! = block 2 is volatile ( ) ) { flags | = volatile ; } if ( ! block 1 get type ( ) equals ( block 2 get type ( ) ) ) { flags | = type ; } if ( block 1 is initialized ( ) ! = block 2 is initialized ( ) ) { flags | = init ; } if ( ! system utilities is equal ( block 1 get source name ( ) , block 2 get source name ( ) ) ) { flags | = source ; } if ( ! system utilities is equal ( block 1 get comment ( ) , block 2 get comment ( ) ) ) { flags | = comment ; } return flags ; }


public builder set diff threshold ( int value ) { this diff threshold = value ; return this ; }


checks a programs memory for 32 bit image base offset references to the address indicated these relative references are only found at addresses that match the indicated alignment

public static set < address > find image base offsets 3 2 ( program program , int alignment , address to address , task monitor monitor ) throws cancelled exception { if ( monitor = = null ) { monitor = task monitor adapter dummy monitor ; } memory memory = program get memory ( ) ; address image base = program get image base ( ) ; long offset value = to address subtract ( image base ) ; int offset size = 4 ; / / 32 bit offset byte [ ] bytes = new byte [ offset size ] ; for ( int i = 0 ; i < offset size ; i + + ) { bytes [ i ] = ( byte ) offset value ; offset value > > = 8 ; / / shift by a single byte } set < address > ibo refs addrs = new tree set < > ( ) ; find byte pattern ( memory , ( address range ) null , bytes , alignment , ibo refs addrs , monitor ) ; return ibo refs addrs ; }


returns the playback position in the stream starting at zero , in microseconds , or { @ link # current position not set } if it is not yet available

long get current position us ( boolean source ended ) ;


test adding one volume on a running mini d f s cluster with only one name node

public void test add one new volume ( ) throws i o exception , reconfiguration exception , interrupted exception , timeout exception { start d f s cluster ( 1 , 1 ) ; string bpid = cluster get namesystem ( ) get block pool id ( ) ; final int num blocks = 10 ; add volumes ( 1 ) ; path test file = new path ( " / test " ) ; create file ( test file , num blocks ) ; list < map < datanode storage , block list as longs > > block reports = cluster get all block reports ( bpid ) ; assert equals ( 1 , block reports size ( ) ) ; / / 1 data node assert equals ( 3 , block reports get ( 0 ) size ( ) ) ; / / 3 volumes / / f s volume list uses round - robin block chooser by default thus the new / / blocks should be evenly located in all volumes int min num blocks = integer max value ; int max num blocks = integer min value ; for ( block list as longs block list : block reports get ( 0 ) values ( ) ) { min num blocks = math min ( min num blocks , block list get number of blocks ( ) ) ; max num blocks = math max ( max num blocks , block list get number of blocks ( ) ) ; } assert true ( math abs ( max num blocks - min num blocks ) < = 1 ) ; verify file length ( cluster get file system ( ) , test file , num blocks ) ; }


returns a predicate that evaluates to true if and only if the input is equivalent to { @ code target } according to this equivalence relation

public final predicate < t > equivalent to ( @ nullable decl t target ) { return new equivalent to predicate < t > ( this , target ) ; }


public cancellable clone async ( org elasticsearch action admin indices shrink resize request resize request , request options options , action listener < org elasticsearch action admin indices shrink resize response > listener ) { return rest high level client perform request async and parse entity ( resize request , indices request converters : : clone , options , org elasticsearch action admin indices shrink resize response : : from x content , listener , empty set ( ) ) ; }


makes sure that every path starts with a " "

private static string normalize path ( string path ) { if ( path starts with ( " / " ) ) { return path ; } else { return ' / ' + path ; } }


gets the producer value for the specified variable , without disturbing it

public value get producer value ( int index ) { return producer variables get value ( index ) ; }


converts the open a p i schema name to a model name suitable for the current code generator may be overriden for each programming language in case the name belongs to the type system it won ' t be renamed

public string to model name ( final string name ) { return camelize ( model name prefix + " " + name + " " + model name suffix ) ; }


initializes the consumer ' s { @ link channel } if a prefetch count has been set in { @ link r m q connection config } , the new channel will be use it for { @ link channel # basic qos ( int ) }

private channel setup channel ( connection connection ) throws exception { channel chan = connection create channel ( ) ; if ( rmq connection config get prefetch count ( ) is present ( ) ) { / / set the global flag for the entire channel , though shouldn ' t make a difference / / since there is only one consumer , and each parallel instance of the source will / / create a new connection ( and channel ) chan basic qos ( rmq connection config get prefetch count ( ) get ( ) , true ) ; } return chan ; }


restart the cluster , optionally saving a new checkpoint

protected static void restart ( boolean checkpoint ) throws exception { name node name node = dfs cluster get name node ( ) ; if ( checkpoint ) { name node adapter enter safe mode ( name node , false ) ; name node adapter save namespace ( name node ) ; } shutdown ( ) ; init cluster ( false ) ; }


remove recovery attempt for the given block

synchronized void remove ( block info block ) { recovery timeouts remove ( new block recovery attempt ( block ) ) ; }


checks if an application - defined state backend is given , and if not , loads the state backend from the configuration , from the parameter ' state backend ' , as defined in { @ link checkpointing options # state backend } if no state backend is configured , this instantiates the default state backend ( the { @ link memory state backend } ) if an application - defined state backend is found , and the state backend is a { @ link configurable state backend } , this methods calls { @ link configurable state backend # configure ( readable config , class loader ) } on the state backend refer to { @ link # load state backend from config ( readable config , class loader , logger ) } for details on how the state backend is loaded from the configuration

public static state backend from application or config or default ( @ nullable state backend from application , configuration config , class loader class loader , @ nullable logger logger ) throws illegal configuration exception , dynamic code loading exception , i o exception { check not null ( config , " config " ) ; check not null ( class loader , " class loader " ) ; final state backend backend ; / / ( 1 ) the application defined state backend has precedence if ( from application ! = null ) { / / see if this is supposed to pick up additional configuration parameters if ( from application instanceof configurable state backend ) { / / needs to pick up configuration if ( logger ! = null ) { logger info ( " using job / cluster config to configure application - defined state backend : { } " , from application ) ; } backend = ( ( configurable state backend ) from application ) configure ( config , class loader ) ; } else { / / keep as is ! backend = from application ; } if ( logger ! = null ) { logger info ( " using application - defined state backend : { } " , backend ) ; } } else { / / ( 2 ) check if the config defines a state backend final state backend from config = load state backend from config ( config , class loader , logger ) ; if ( from config ! = null ) { backend = from config ; } else { / / ( 3 ) use the default backend = new memory state backend factory ( ) create from config ( config , class loader ) ; if ( logger ! = null ) { logger info ( " no state backend has been configured , using default ( memory / job manager ) { } " , backend ) ; } } } return backend ; }


start analysis the litepal xml file set all the parsed value into the lite pal attr model

public void start element ( string uri , string local name , string q name , attributes attributes ) throws s a x exception { if ( lite pal parser node db name equals ignore case ( local name ) ) { for ( int i = 0 ; i < attributes get length ( ) ; i + + ) { if ( lite pal parser attr value equals ignore case ( attributes get local name ( i ) ) ) { lite pal attr set db name ( attributes get value ( i ) trim ( ) ) ; } } } else if ( lite pal parser node version equals ignore case ( local name ) ) { for ( int i = 0 ; i < attributes get length ( ) ; i + + ) { if ( lite pal parser attr value equals ignore case ( attributes get local name ( i ) ) ) { lite pal attr set version ( integer parse int ( attributes get value ( i ) trim ( ) ) ) ; } } } else if ( lite pal parser node mapping equals ignore case ( local name ) ) { for ( int i = 0 ; i < attributes get length ( ) ; i + + ) { if ( lite pal parser attr class equals ignore case ( attributes get local name ( i ) ) ) { lite pal attr add class name ( attributes get value ( i ) trim ( ) ) ; } } } else if ( lite pal parser node cases equals ignore case ( local name ) ) { for ( int i = 0 ; i < attributes get length ( ) ; i + + ) { if ( lite pal parser attr value equals ignore case ( attributes get local name ( i ) ) ) { lite pal attr set cases ( attributes get value ( i ) trim ( ) ) ; } } } else if ( lite pal parser node storage equals ignore case ( local name ) ) { for ( int i = 0 ; i < attributes get length ( ) ; i + + ) { if ( lite pal parser attr value equals ignore case ( attributes get local name ( i ) ) ) { lite pal attr set storage ( attributes get value ( i ) trim ( ) ) ; } } } }


add an action listener to be invoked when a response has received

void add listener ( action listener < t > listener ) ;


returns the deadline or { @ code null } if the deadline is not set

public deadline get deadline ( ) { return deadline ; }


updates the corresponding record by id with content values returns the number of affected rows content values cv = new content values ( ) ; cv put ( & quot ; name & quot ; , & quot ; jim & quot ; ) ; lite pal update ( person class , cv , 1 ) ; this means that the name of record 1 will be updated into jim < br >

public static int update ( class < ? > model class , content values values , long id ) { return operator update ( model class , values , id ) ; }


public string get small snake ( ) { return small snake ; }


test request scoped caching of commands so that a 2nd duplicate call doesn ' t execute but returns the previous future

public void test request cache with slow execution ( ) { test circuit breaker circuit breaker = new test circuit breaker ( ) ; slow cacheable command command 1 = new slow cacheable command ( circuit breaker , " a " , 200 ) ; slow cacheable command command 2 = new slow cacheable command ( circuit breaker , " a " , 100 ) ; slow cacheable command command 3 = new slow cacheable command ( circuit breaker , " a " , 100 ) ; slow cacheable command command 4 = new slow cacheable command ( circuit breaker , " a " , 100 ) ; future < string > f 1 = command 1 observe ( ) to blocking ( ) to future ( ) ; future < string > f 2 = command 2 observe ( ) to blocking ( ) to future ( ) ; future < string > f 3 = command 3 observe ( ) to blocking ( ) to future ( ) ; future < string > f 4 = command 4 observe ( ) to blocking ( ) to future ( ) ; try { assert equals ( " a " , f 2 get ( ) ) ; assert equals ( " a " , f 3 get ( ) ) ; assert equals ( " a " , f 4 get ( ) ) ; assert equals ( " a " , f 1 get ( ) ) ; } catch ( exception e ) { throw new runtime exception ( e ) ; } assert true ( command 1 executed ) ; / / the second one should not have executed as it should have received the cached value instead assert false ( command 2 executed ) ; assert false ( command 3 executed ) ; assert false ( command 4 executed ) ; / / the execution log for command 1 should show an emit and a success assert command execution events ( command 1 , hystrix event type emit , hystrix event type success ) ; assert true ( command 1 get execution time in milliseconds ( ) > - 1 ) ; assert false ( command 1 is response from cache ( ) ) ; / / the execution log for command 2 should show it came from cache assert command execution events ( command 2 , hystrix event type emit , hystrix event type success , hystrix event type response from cache ) ; assert true ( command 2 get execution time in milliseconds ( ) = = - 1 ) ; assert true ( command 2 is response from cache ( ) ) ; assert command execution events ( command 3 , hystrix event type emit , hystrix event type success , hystrix event type response from cache ) ; assert true ( command 3 is response from cache ( ) ) ; assert true ( command 3 get execution time in milliseconds ( ) = = - 1 ) ; assert command execution events ( command 4 , hystrix event type emit , hystrix event type success , hystrix event type response from cache ) ; assert true ( command 4 is response from cache ( ) ) ; assert true ( command 4 get execution time in milliseconds ( ) = = - 1 ) ; assert sane hystrix request log ( 4 ) ; / / semaphore isolated assert false ( command 1 is executed in thread ( ) ) ; assert false ( command 2 is executed in thread ( ) ) ; assert false ( command 3 is executed in thread ( ) ) ; assert false ( command 4 is executed in thread ( ) ) ; }


get a collection of the replicas for given block pool this method is < b > not synchronized < b > it needs to be synchronized externally using the lock , both for getting the replicas values from the map and iterating over it mutex can be accessed using { @ link # get lock ( ) } method

collection < replica info > replicas ( string bpid ) { return map get ( bpid ) ; }


called by { @ link executor } to perform the task

@ override void run ( ) throws asynchronous execution ;


return the protocol scheme for the file system

public string get scheme ( ) { return cos n file system scheme ; }


sets { @ link format # pcm encoding } the default value is { @ link # no value }

public builder set pcm encoding ( @ c pcm encoding int pcm encoding ) { this pcm encoding = pcm encoding ; return this ; }


creates a { @ link dynamic table sink } instance from a { @ link catalog table } and additional context information an implementation should perform validation and the discovery of further ( nested ) factories in this method

dynamic table sink create dynamic table sink ( context context ) ;


protected void dismiss callback ( ) { close ( ) ; }


gets the data type of the appropriate size to be placed at the indicated component index

protected data type instance get drop data type ( int row index , data type dt ) throws invalid data type exception , cancelled exception { field range range = get selected range containing ( row index ) ; / / is the index in a selection if ( range ! = null ) { / / set the index to the minimum index in this range row index = range get start ( ) get index ( ) int value ( ) ; } boolean dynamic sizing allowed = true ; data type current dt = null ; data type component dtc = get component ( row index ) ; if ( dtc ! = null ) { dynamic sizing allowed = ! dtc is flexible array component ( ) ; current dt = dtc get data type ( ) ; } if ( ! ( current dt instanceof pointer ) ) { / / stacking on pointer allows any data type check is allowable data type ( dt , dynamic sizing allowed ) ; } data type result dt = data utilities reconcile applied data type ( current dt , dt , true ) ; int result len = result dt get length ( ) ; if ( result dt instanceof dynamic ) { result len = data type helper request dt size ( get provider ( ) , result dt get display name ( ) , last num bytes , get max add length ( row index ) ) ; } else if ( result len = = 0 ) { throw new invalid data type exception ( " data types of size 0 are not allowed " ) ; } return data type instance get data type instance ( result dt , result len ) ; }


get the user log directory for the job jobid

public static file get job dir ( job i d jobid ) { return new file ( get user log dir ( ) , jobid to string ( ) ) ; }


protected void ok callback ( ) { apply callback ( ) ; close ( ) ; }


shortcut for { @ link serialization feature # indent output } option

public void set indent output ( boolean indent output ) { this builder indent output ( indent output ) ; }


returns a list of realms that are configured , but are not permitted under the current license

public list < realm > get unlicensed realms ( ) { final x pack license state license state snapshot = license state copy current license state ( ) ; / / if auth is not allowed , then everything is unlicensed if ( license state snapshot is security enabled ( ) = = false ) { return collections unmodifiable list ( realms ) ; } / / if all realms are allowed , then nothing is unlicensed if ( license state snapshot check feature ( feature security all realms ) ) { return collections empty list ( ) ; } final list < realm > allowed realms = this as list ( ) ; / / shortcut for the typical case , all the configured realms are allowed if ( allowed realms equals ( this realms ) ) { return collections empty list ( ) ; } / / otherwise , we return anything in " all realms " that is not in the allowed realm list list < realm > unlicensed = realms stream ( ) filter ( r - > allowed realms contains ( r ) = = false ) collect ( collectors to list ( ) ) ; return collections unmodifiable list ( unlicensed ) ; }


returns true if the raw value of this { @ link cookie } , was wrapped with double quotes in original set - cookie header


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


creates a new deployment entry enriched with additional properties that are prefixed with { @ link environment # deployment entry }

public static deployment entry enrich ( deployment entry deployment , map < string , string > prefixed properties ) { final map < string , string > enriched properties = new hash map < > ( deployment as map ( ) ) ; prefixed properties for each ( ( k , v ) - > { final string normalized key = k to lower case ( ) ; if ( k starts with ( deployment entry + ' ' ) ) { enriched properties put ( normalized key substring ( deployment entry length ( ) + 1 ) , v ) ; } } ) ; final descriptor properties properties = new descriptor properties ( true ) ; properties put properties ( enriched properties ) ; return new deployment entry ( properties ) ; }


return an array of { @ link resolvable type resolvable types } representing the generic parameters of this type if no generics are available an empty array is returned if you need to access a specific generic consider using the { @ link # get generic ( int ) } method as it allows access to nested generics and protects against { @ code index out of bounds exceptions }

public resolvable type [ ] get generics ( ) { if ( this = = none ) { return empty types array ; } resolvable type [ ] generics = this generics ; if ( generics = = null ) { if ( this type instanceof class ) { type [ ] type params = ( ( class < ? > ) this type ) get type parameters ( ) ; generics = new resolvable type [ type params length ] ; for ( int i = 0 ; i < generics length ; i + + ) { generics [ i ] = resolvable type for type ( type params [ i ] , this ) ; } } else if ( this type instanceof parameterized type ) { type [ ] actual type arguments = ( ( parameterized type ) this type ) get actual type arguments ( ) ; generics = new resolvable type [ actual type arguments length ] ; for ( int i = 0 ; i < actual type arguments length ; i + + ) { generics [ i ] = for type ( actual type arguments [ i ] , this variable resolver ) ; } } else { generics = resolve type ( ) get generics ( ) ; } this generics = generics ; } return generics ; }


gets the { @ code enclosing method } attribute out of a given { @ link attribute list } , if any , translating it to an annotation if the class really has an enclosing method , this returns an { @ code enclosing method } annotation ; if not , this returns an { @ code enclosing class } annotation

private static annotation translate enclosing method ( attribute list attribs ) { att enclosing method enclosing method = ( att enclosing method ) attribs find first ( att enclosing method attribute name ) ; if ( enclosing method = = null ) { return null ; } cst type enclosing class = enclosing method get enclosing class ( ) ; cst nat nat = enclosing method get method ( ) ; if ( nat = = null ) { / * * dalvik doesn ' t use enclosing method annotations unless * there really is an enclosing method anonymous classes * are unambiguously identified by having an inner class * annotation with an empty name along with an appropriate * enclosing class * / return annotation utils make enclosing class ( enclosing class ) ; } return annotation utils make enclosing method ( new cst method ref ( enclosing class , nat ) ) ; }


public handle range ( grammar a s t a , grammar a s t b ) { g tool err mgr grammar error ( error type token range in parser , g file name , a get token ( ) , a get token ( ) get text ( ) , b get token ( ) get text ( ) ) ; / / from a b , yield atn for just a return token ref ( ( terminal a s t ) a ) ; }


sets whether the start position and the end position are relative to the default position in the window ( default : { @ code false } )

public builder set clip relative to default position ( boolean relative to default position ) { this clip relative to default position = relative to default position ; return this ; }


look for placeholder with the same name and group if such a placeholder exists , then there is already at least one instance of this provider showing and we will stack the new provider on top of this one , ignoring any windowing positioning specified by the new provider

private component placeholder find best placeholder to stack upon ( set < component placeholder > active placeholders , component placeholder new info ) { string name = new info get name ( ) ; string group = new info get group ( ) ; for ( component placeholder placeholder : active placeholders ) { if ( name equals ( placeholder get name ( ) ) & & group equals ( placeholder get group ( ) ) ) { return placeholder ; } } return null ; }


fully read up to { @ code length } bytes from the given { @ link input stream }

private static int read fully ( input stream input stream , final byte buffer b , int length , checked runnable < i o exception > on e o f ) throws i o exception { int total read = 0 ; final byte [ ] buffer = new byte [ math min ( length , copy buffer size ) ] ; while ( total read < length ) { final int len = math min ( length - total read , copy buffer size ) ; final int read = input stream read ( buffer , 0 , len ) ; if ( read = = - 1 ) { on e o f run ( ) ; break ; } b put ( buffer , 0 , read ) ; total read + = read ; } return total read > 0 ? total read : - 1 ; }


protected int get num connections ( ) { return this connections size ( ) ; }


get the delay that should be used for delaying a response in accordance with configured behavior

public long calculate delay ( time unit unit ) { float delta = variance percent / 1 0 0f ; / / e g , 20 / 1 0 0f = = 0 2f float lower bound = 1f - delta ; / / 0 2f - - > 0 8f float upper bound = 1f + delta ; / / 0 2f - - > 1 2f float bound = upper bound - lower bound ; / / 1 2f - 0 8f = = 0 4f float delay percent = lower bound + ( random next float ( ) * bound ) ; / / 0 8 + ( rnd * 0 4 ) long call delay ms = ( long ) ( delay ms * delay percent ) ; return milliseconds convert ( call delay ms , unit ) ; }


find the program address at which a specified offset within a section or segment was loadedresolved

address find load address ( memory loadable section , long byte offset within section ) ;


consume an instance ( possibly shared or independent ) of the object managed by this factory , if available

default void if available ( consumer < t > dependency consumer ) throws beans exception { t dependency = get if available ( ) ; if ( dependency ! = null ) { dependency consumer accept ( dependency ) ; } }


test on the deny engine and allow engine pair the evaluation result of two cel expressions is set to true , and the evaluation result of one cel expression is set to false in deny engine , so the g r p c authorization returns deny

public void test engine pair with partially matched deny engine ( ) throws interpreter exception { setup engine rbac pair ( ) ; / / policy 4 - unmatched ; policy 5 - matched ; policy 6 - unknown / / policy 1 - matched ; policy 2 - matched ; policy 3 - matched do return ( true ) when ( spy engine ) matches ( eq ( condition 1 ) , any ( activation class ) ) ; do return ( true ) when ( spy engine ) matches ( eq ( condition 2 ) , any ( activation class ) ) ; do return ( true ) when ( spy engine ) matches ( eq ( condition 3 ) , any ( activation class ) ) ; do return ( false ) when ( spy engine ) matches ( eq ( condition 4 ) , any ( activation class ) ) ; do return ( true ) when ( spy engine ) matches ( eq ( condition 5 ) , any ( activation class ) ) ; do throw ( new interpreter exception builder ( " unknown result " ) build ( ) ) when ( spy engine ) matches ( eq ( condition 6 ) , any ( activation class ) ) ; evaluate result = spy engine evaluate ( args ) ; assert that ( evaluate result get decision ( ) ) is equal to ( authorization decision output deny ) ; assert that ( evaluate result get policy names ( ) ) has size ( 1 ) ; assert that ( evaluate result get policy names ( ) ) contains ( " policy 5 " ) ; }


saves the current chart state with the given name to the given path on the sdcard leaving the path empty " " will put the saved file directly on the sd card chart is saved as a png image , example : save to path ( " myfilename " , " foldername 1foldername 2 " ) ;

public boolean save to path ( string title , string path on s d ) { bitmap b = get chart bitmap ( ) ; output stream stream = null ; try { stream = new file output stream ( environment get external storage directory ( ) get path ( ) + path on s d + " / " + title + " png " ) ; / * * write bitmap to file using jpeg or png and 40 % quality hint for * jpeg * / b compress ( compress format png , 40 , stream ) ; stream close ( ) ; } catch ( exception e ) { e print stack trace ( ) ; return false ; } return true ; }


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


private void print results ( list < plugin wrapper plugin disable result > results ) { for ( plugin wrapper plugin disable result one result : results ) { print result ( one result , 0 ) ; } }


gets the main thread execution context the main thread execution context can be used to execute tasks in the main thread of the underlying rpc endpoint

protected main thread executor get main thread executor ( ) { return main thread executor ; }


creates a mutable { @ code hash set } instance initially containing the given elements < b > note : < b > if elements are non - null and won ' t be added or removed after this point , use { @ link immutable set # of ( ) } or { @ link immutable set # copy of ( object [ ] ) } instead if { @ code e } is an { @ link enum } type , use { @ link enum set # of ( enum , enum [ ] ) } instead otherwise , strongly consider using a { @ code linked hash set } instead , at the cost of increased memory footprint , to get deterministic iteration behavior this method is just a small convenience , either for { @ code new hash set ( } { @ link arrays # as list as list } { @ code ( ) ) } , or for creating an empty set then calling { @ link collections # add all } this method is not actually very useful and will likely be deprecated in the future

public static < e > hash set < e > new hash set ( e elements ) { hash set < e > set = new hash set with expected size ( elements length ) ; collections add all ( set , elements ) ; return set ; }


set a custom scheme for the target service , for example ' https '

public api client set scheme ( string scheme ) { this scheme = scheme ; return this ; }


protected void update ticket state ( ) { logger trace ( " before updating ticket [ { } ] \ n \ t previous time used : [ { } ] \ n \ t last time used : [ { } ] \ n \ t usage count : [ { } ] " , get id ( ) , this previous time used , this last time used , this count of uses ) ; this previous time used = zoned date time from ( this last time used ) ; this last time used = zoned date time now ( this expiration policy get clock ( ) ) ; this count of uses + + ; logger trace ( " after updating ticket [ { } ] \ n \ t previous time used : [ { } ] \ n \ t last time used : [ { } ] \ n \ t usage count : [ { } ] " , get id ( ) , this previous time used , this last time used , this count of uses ) ; }


returns whether the current window is dynamic , or { @ code false } if the { @ link timeline } is empty


mark the block belonging to datanode as corrupt

void add to corrupt replicas map ( block blk , datanode descriptor dn , string reason , reason reason code , boolean is striped ) { map < datanode descriptor , reason > nodes = corrupt replicas map get ( blk ) ; if ( nodes = = null ) { nodes = new hash map < datanode descriptor , reason > ( ) ; corrupt replicas map put ( blk , nodes ) ; increment block stat ( is striped ) ; } string reason text ; if ( reason ! = null ) { reason text = " because " + reason ; } else { reason text = " " ; } if ( ! nodes key set ( ) contains ( dn ) ) { name node block state change log debug ( " block name system add to corrupt replicas map : { } added as corrupt on " + " { } by { } { } " , blk , dn , server get remote ip ( ) , reason text ) ; } else { name node block state change log debug ( " block name system add to corrupt replicas map : duplicate requested for " + " { } to add as corrupt on { } by { } { } " , blk , dn , server get remote ip ( ) , reason text ) ; } / / add the node or update the reason nodes put ( dn , reason code ) ; }


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

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


complete the target with a single value or indicate there is a value available in fusion mode

public final void complete ( t value ) { int state = get ( ) ; if ( ( state & ( fused ready | fused consumed | terminated | disposed ) ) ! = 0 ) { return ; } observer < ? super t > a = downstream ; if ( state = = fused empty ) { this value = value ; lazy set ( fused ready ) ; a on next ( null ) ; } else { lazy set ( terminated ) ; a on next ( value ) ; } if ( get ( ) ! = disposed ) { a on complete ( ) ; } }


will not return any non - decryptable member u u i ds

public static array list < uuid > removed requesting members uuid list ( decrypted group change group change ) { list < byte string > delete requesting members = group change get delete requesting members list ( ) ; array list < uuid > uuid list = new array list < > ( delete requesting members size ( ) ) ; for ( byte string member : delete requesting members ) { uuid uuid = to uuid ( member ) ; if ( ! uuid util unknown uuid equals ( uuid ) ) { uuid list add ( uuid ) ; } } return uuid list ; }


return the property value if it ' s non - negative and throw an exception if it ' s not

private long get non negative ( string key , int default value ) { int flush offset interval millis = properties get int ( key , default value ) ; if ( flush offset interval millis < 0 ) { throw new metrics exception ( " the " + key + " property must be " + " non - negative value was " + flush offset interval millis ) ; } return flush offset interval millis ; }


constructs a create operation arguments are as for the zoo keeper method of the same name

public static op create ( string path , byte [ ] data , list < acl > acl , int flags ) { return new create ( path , data , acl , flags ) ; }


called after the fielddata is loaded during the cache phase

default void on cache ( shard id shard id , string field name , accountable ram usage ) { }


creates a { @ link monitoring doc node } from a { @ link discovery node } and a timestamp , copying over the required information

public static monitoring doc node convert node ( final long timestamp , final @ nullable discovery node node ) { if ( node = = null ) { return null ; } return new monitoring doc node ( node get id ( ) , node get host name ( ) , node get address ( ) to string ( ) , node get host address ( ) , node get name ( ) , timestamp ) ; }


public void cancel ( ) throws s q l exception { check closed ( ) ; }


public synchronized boolean next ( text key , text value ) throws i o exception { text t key = key ; text t value = value ; if ( ! sequence file record reader next ( inner key , inner value ) ) { return false ; } t key set ( inner key to string ( ) ) ; t value set ( inner value to string ( ) ) ; return true ; }


public dalv insn with opcode ( dop opcode ) { return new simple insn ( opcode , get position ( ) , get registers ( ) ) ; }


public void stop writing ( ) { done = true ; }


tells the camera to stop drawing preview frames

public synchronized void stop preview ( ) { if ( auto focus manager ! = null ) { auto focus manager stop ( ) ; auto focus manager = null ; } if ( camera ! = null & & previewing ) { camera get camera ( ) stop preview ( ) ; preview callback set handler ( null , 0 ) ; previewing = false ; } }


draw the depth buffer to a texture slow , should only be used for debugging purposes

public texture region draw debug texture ( ) { if ( debug pixmap = = null ) { debug pixmap = new pixmap ( buffer width , buffer height , pixmap format rgba8888 ) ; debug texture = new texture ( debug pixmap ) ; debug texture region = new texture region ( debug texture ) ; debug texture region flip ( false , true ) ; } debug pixmap set color ( color black ) ; debug pixmap fill ( ) ; / / find min / max depth values in buffer float min depth = float positive infinity ; float max depth = float negative infinity ; buffer clear ( ) ; while ( buffer position ( ) < buffer capacity ( ) ) { float depth = math utils clamp ( buffer get ( ) , 0 , float positive infinity ) ; min depth = math min ( depth , min depth ) ; max depth = math max ( depth , max depth ) ; } float extent = 1 / ( max depth - min depth ) ; buffer clear ( ) ; / / draw to pixmap for ( int x = 0 ; x < buffer width ; x + + ) { for ( int y = 0 ; y < buffer height ; y + + ) { float depth = math utils clamp ( buffer get ( x + y * buffer width ) , 0 , float positive infinity ) ; float c = depth * extent ; debug pixmap draw pixel ( x , y , color rgba 8 8 8 8 ( c , c , c , 1 ) ) ; } } debug texture draw ( debug pixmap , 0 , 0 ) ; return debug texture region ; }


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


public integer get integer ( ) { return integer ; }


process the sasl ' s negotiate request , including the optimization of accelerating token negotiation

private rpc sasl proto build sasl negotiate response ( ) throws interrupted exception , sasl exception , i o exception { rpc sasl proto negotiate message = negotiate response ; / / accelerate token negotiation by sending initial challenge / / in the negotiation response if ( enabled auth methods contains ( auth method token ) ) { sasl server = create sasl server ( auth method token ) ; byte [ ] challenge = sasl server evaluate response ( new byte [ 0 ] ) ; rpc sasl proto builder negotiate builder = rpc sasl proto new builder ( negotiate response ) ; negotiate builder get auths builder ( 0 ) / / token is always first set challenge ( byte string copy from ( challenge ) ) ; negotiate message = negotiate builder build ( ) ; } sent negotiate = true ; return negotiate message ; }


just like assert null ( x ) , but additionally recording ( using thread record failure ) any assertion failed error thrown , so that the current testcase will fail

public void thread assert null ( object x ) { try { assert null ( x ) ; } catch ( assertion failed error t ) { thread record failure ( t ) ; throw t ; } }


returns the { @ code path fragment } which represents a directory where the generated obj c files reside

public path fragment get objc file path ( ) { return objc file path ; }


public static < t extends base string cipher executor > t new string cipher executor ( final encryption jwt signing jwt cryptography properties crypto , final class < t > cipher class ) { val ctor = cipher class get declared constructor ( string class , string class , string class , int class , int class ) ; val cipher = ( t ) ctor new instance ( crypto get encryption ( ) get key ( ) , crypto get signing ( ) get key ( ) , crypto get alg ( ) , crypto get signing ( ) get key size ( ) , crypto get encryption ( ) get key size ( ) ) ; cipher set strategy type ( base string cipher executor cipher operations strategy type value of ( crypto get strategy type ( ) ) ) ; return cipher ; }


test serialization of object with outer number type

public void fake outer composite serialize test ( ) { outer composite outer composite = null ; / / outer composite response = api fake outer composite serialize ( outer composite ) ; / / todo : test validations }


factory method for creating instances of { @ link key }

public static < t > key < t > create with default ( string debug string , t default value ) { preconditions check not null ( debug string , " debug string " ) ; return new key < > ( debug string , default value ) ; }


drops a view in a given fully qualified path

public void drop view ( object identifier object identifier , boolean ignore if not exists ) { drop table internal ( object identifier , ignore if not exists , false ) ; }


public static void set record length ( configuration conf , int record length ) { conf set int ( fixed record length , record length ) ; }


set the buffer ' s size default size equals 8192 bytes

public static void set buffer size ( final int buffer size ) { s buffer size = buffer size ; }


public static void toggle full screen ( @ non null final activity activity ) { boolean is full screen = is full screen ( activity ) ; window window = activity get window ( ) ; if ( is full screen ) { window clear flags ( window manager layout params flag fullscreen ) ; } else { window add flags ( window manager layout params flag fullscreen ) ; } }


get the number of blocks to be transferred


public unmarshaller get unmarshaller ( ) { return this unmarshaller ; }


indicate whether the encryption context is reset certain modes , like ctr , require a different iv depending on the position in the stream generally , the encryptor maintains any necessary context for calculating the iv and counter so that no reinit is necessary during the encryption reinit before each operation is inefficient


should only be called by one thread , and only after all accesses to the db happened

public void dispose ( ) { if ( this disposed ) { return ; } super dispose ( ) ; / / this call will block until all clients that still acquire access to the rocks d b instance / / have released it , / / so that we cannot release the native resources while clients are still working with it in / / parallel rocks d b resource guard close ( ) ; / / important : null reference to signal potential async checkpoint workers that the db was / / disposed , as / / working on the disposed object results in segfaults if ( db ! = null ) { i o utils close quietly ( write batch wrapper ) ; / / metric collection occurs on a background thread when this method returns / / it is guaranteed that thr rocks d b reference has been invalidated / / and no more metric collection will be attempted against the database if ( native metric monitor ! = null ) { native metric monitor close ( ) ; } list < column family options > column family options = new array list < > ( kv state information values ( ) size ( ) ) ; / / rocks d b ' s native memory management requires that * all * c fs ( including default ) are / / closed before the / / db is closed see : / / https : / / github com / facebook / rocksdb / wiki / rocks java - basics # opening - a - database - with - column - families / / start with default cf rocks d b operation utils add column family options to close later ( column family options , default column family ) ; i o utils close quietly ( default column family ) ; / / continue with the ones created by flink for ( rocks db kv state info kv state info : kv state information values ( ) ) { rocks d b operation utils add column family options to close later ( column family options , kv state info column family handle ) ; i o utils close quietly ( kv state info column family handle ) ; } / / and finally close the db instance i o utils close quietly ( db ) ; column family options for each ( i o utils : : close quietly ) ; i o utils close quietly ( options container ) ; ttl compact filters manager dispose and clear registered compaction factories ( ) ; kv state information clear ( ) ; clean instance base path ( ) ; } this disposed = true ; }


releases a generation that was acquired by { @ link # acquire translog gen ( long ) }

private synchronized void release translog gen ( long translog gen ) { counter current = translog ref counts get ( translog gen ) ; if ( current = = null | | current get ( ) < = 0 ) { throw new illegal argument exception ( " translog gen [ " + translog gen + " ] wasn ' t acquired " ) ; } if ( current add and get ( - 1 ) = = 0 ) { translog ref counts remove ( translog gen ) ; } }


block until await termination ( ) has been called on this class

public void wait until await termination ( long timeout , time unit time unit ) throws interrupted exception , timeout exception { await termination waiter await ( timeout , time unit ) ; }


returns the values from each provided array combined into a single array for example , { @ code concat ( new byte [ ] { a , b } , new byte [ ] { } , new byte [ ] { c } } returns the array { @ code { a , b , c } }

public static byte [ ] concat ( byte [ ] arrays ) { int length = 0 ; for ( byte [ ] array : arrays ) { length + = array length ; } byte [ ] result = new byte [ length ] ; int pos = 0 ; for ( byte [ ] array : arrays ) { system arraycopy ( array , 0 , result , pos , array length ) ; pos + = array length ; } return result ; }


drops a temporary catalog function registered in the given path if a permanent function with the given path exists , it will be used from now on for any queries that reference this path

boolean drop temporary function ( string path ) ;


public void append table modifiers ( d b r progress monitor monitor , string builder ddl ) { / / nothing }


test serialization of outer string types

public string fake outer string serialize ( string body ) throws api exception { api response < string > local var resp = fake outer string serialize with http info ( body ) ; return local var resp get data ( ) ; }


parses the scheme specific data from a pssh atom version 0 and 1 pssh atoms are supported the scheme specific data is only parsed if the data is a valid pssh atom matching the given uuid , or if the data is a valid pssh atom of any type in the case that the passed uuid is null

public static byte [ ] parse scheme specific data ( byte [ ] atom , uuid uuid ) { @ nullable pssh atom parsed atom = parse pssh atom ( atom ) ; if ( parsed atom = = null ) { return null ; } if ( uuid ! = null & & ! uuid equals ( parsed atom uuid ) ) { log w ( tag , " uuid mismatch expected : " + uuid + " , got : " + parsed atom uuid + " " ) ; return null ; } return parsed atom scheme data ; }


returns { @ code true } if the arguments are equal to each other and { @ code false } otherwise this method has the following restrictions : reflexive - { @ code equals ( a , a ) } should return true symmetric - { @ code equals ( a , b ) } returns { @ code true } if { @ code equals ( b , a ) } returns { @ code true } transitive - if { @ code equals ( a , b ) } returns { @ code true } and { @ code equals ( a , c ) } returns { @ code true } then { @ code equals ( b , c ) } should also return { @ code true } consistent - { @ code equals ( a , b ) } should return the same result when called multiple times assuming { @ code a } and { @ code b } remain unchanged relative to the comparison criteria if { @ code a } and { @ code b } are both { @ code null } then this method returns { @ code true } if { @ code a } is { @ code null } and { @ code b } is non - { @ code null } , or { @ code a } is non - { @ code null } and { @ code b } is { @ code null } then this method returns { @ code false }


should only public methods be allowed to have caching semantics ? the default implementation returns { @ code false }

protected boolean allow public methods only ( ) { return false ; }


returns true if avoid - first - lastclipping is enabled , false if not

public boolean is avoid first last clipping enabled ( ) { return m avoid first last clipping ; }


add a { @ link event listener dubbo event listener }

void add event listener ( e listener ) throws null pointer exception , illegal argument exception ;


public boolean supports ( final j e e context context ) { return context get request attribute ( o auth 2 0 constants error ) is present ( ) ; }


post fake { pet id } upload image with required file : uploads an image ( required )

default response entity < model api response > upload file with required file ( @ api param ( value = " id of pet to update " , required = true ) @ path variable ( " pet id " ) long pet id , @ api param ( value = " file to upload " ) @ valid @ request part ( value = " required file " , required = true ) multipart file required file , @ api param ( value = " additional data to pass to server " ) @ valid @ request part ( value = " additional metadata " , required = false ) string additional metadata ) { return get delegate ( ) upload file with required file ( pet id , required file , additional metadata ) ; }


specify the custom editors to register via a { @ link map } , using the class name of the required type as the key and the class name of the associated { @ link property editor } as value

public void set custom editors ( map < class < ? > , class < ? extends property editor > > custom editors ) { this custom editors = custom editors ; }


get the array stringable for a specified data type not used on an array data type , but on array ' s element ' s type

public static array stringable get array stringable ( data type dt ) { if ( dt instanceof type def ) { dt = ( ( type def ) dt ) get base data type ( ) ; } return ( dt instanceof array stringable ) ? ( array stringable ) dt : null ; }


adds new futures to be combined new futures may be added until an aggregate promise is added via the { @ link promise combiner # finish ( promise ) } method

public void add all ( future futures ) { for ( future future : futures ) { this add ( future ) ; } }


returns if we are building external runfiles symlinks using the old - style structure

public boolean legacy external runfiles ( ) { return options legacy external runfiles ; }


selects the row under the given mouse point this method is useful when the user triggers a popup mouse action and you would like to have the table select that row if it is not already selected this allows you to guarantee that there is always a selection when the user triggers a popup menu

public boolean select row ( mouse event event ) { if ( event get source ( ) ! = this ) { return false ; } int row = row at point ( event get point ( ) ) ; if ( row > = 0 ) { if ( ! is row selected ( row ) ) { set row selection interval ( row , row ) ; } return true ; } return false ; }


sets the working directory to use , if any

public command line builder set working directory ( path working directory ) { this working directory = working directory ; return this ; }


public void close ( ) { close ( close mode graceful ) ; }


test that the slot manager release resource when the number of slots exceed max limit when new task executor registered

public void test max slot limit register worker ( ) throws exception { final int number slots = 1 ; final int max slot num = 1 ; final completable future < instance i d > released resource future = new completable future < > ( ) ; resource actions resource actions = create resource actions builder ( ) set release resource consumer ( ( instance i d , e ) - > released resource future complete ( instance i d ) ) build ( ) ; try ( final task executor manager task executor manager = create task executor manager builder ( ) set num slots per worker ( number slots ) set max num slots ( max slot num ) set resource actions ( resource actions ) create task executor manager ( ) ) { create and register task executor ( task executor manager , 1 , resource profile any ) ; instance i d rejected task executor id = create and register task executor ( task executor manager , 1 , resource profile any ) ; assert that ( released resource future get ( ) , is ( rejected task executor id ) ) ; } }


continues a read from the provided { @ code source } into a given { @ code target } it ' s assumed that the data should be written into { @ code target } starting from an offset of zero

private boolean continue read ( parsable byte array source , byte [ ] target , int target length ) { int bytes to read = min ( source bytes left ( ) , target length - bytes read ) ; source read bytes ( target , bytes read , bytes to read ) ; bytes read + = bytes to read ; return bytes read = = target length ; }


returns the first artifact found in the given set whose path ends with the given suffix

public static artifact get first artifact ending with ( nested set < ? extends artifact > artifacts , string suffix ) { return get first artifact ending with ( artifacts to list ( ) , suffix ) ; }


build a json entry from the parameters this is public for testing

public writer to json ( final writer writer , final string logger name , final long time stamp , final string level , final string thread name , final string message , final throwable information ti ) throws i o exception { json generator json = factory create generator ( writer ) ; json write start object ( ) ; json write string field ( name , logger name ) ; json write number field ( time , time stamp ) ; date date = new date ( time stamp ) ; json write string field ( date , date format format ( date ) ) ; json write string field ( level , level ) ; json write string field ( thread , thread name ) ; json write string field ( message , message ) ; if ( ti ! = null ) { / / there is some throwable info , but if the log event has been sent over the wire , / / there may not be a throwable inside it , just a summary throwable thrown = ti get throwable ( ) ; string eclass = ( thrown ! = null ) ? thrown get class ( ) get name ( ) : " " ; json write string field ( exception class , eclass ) ; string [ ] stack trace = ti get throwable str rep ( ) ; json write array field start ( stack ) ; for ( string row : stack trace ) { json write string ( row ) ; } json write end array ( ) ; } json write end object ( ) ; json flush ( ) ; json close ( ) ; return writer ; }


sets the doc source of the update request to be used when the document does not exists

public update request upsert ( string source , x content type x content type ) { safe upsert request ( ) source ( source , x content type ) ; return this ; }


move all records from index to the end by the specified offset

private int move records ( int index , int offset ) { int last index = key count - 1 ; / / no movement needed for appended record if ( index = = key count ) { if ( index = = 0 ) { return buffer length ( ) + offset ; } return get record key offset ( last index ) + offset ; } / / determine block to be moved int start = get record key offset ( last index ) ; int end = ( index = = 0 ) ? buffer length ( ) : get record key offset ( index - 1 ) ; int len = end - start ; / / move record data buffer move ( start , start + offset , len ) ; / / adjust stored offsets for ( int i = index ; i < key count ; i + + ) { put record key offset ( i , get record key offset ( i ) + offset ) ; } return end + offset ; }


register a callback to be executed on destruction of the specified attribute in the given scope implementations should do their best to execute the callback at the appropriate time : that is , at request completion or session termination , respectively if such a callback is not supported by the underlying runtime environment , the callback must be ignored and a corresponding warning should be logged note that ' destruction ' usually corresponds to destruction of the entire scope , not to the individual attribute having been explicitly removed by the application if an attribute gets removed via this facade ' s { @ link # remove attribute ( string , int ) } method , any registered destruction callback should be disabled as well , assuming that the removed object will be reused or manually destroyed < b > note : < b > callback objects should generally be serializable if they are being registered for a session scope otherwise the callback ( or even the entire session ) might not survive web app restarts

void register destruction callback ( string name , runnable callback , int scope ) ;


public long get ( t key ) throws no value exception { int index = indexer get ( key ) ; if ( index < 0 ) { throw no value exception no value exception ; } return values [ index ] ; }


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


public test string overloads view model title via value shortcut quantity res ( @ plurals res int plural res , int quantity , object format args ) { on mutation ( ) ; assigned attributes epoxy generated model set ( 2 ) ; title via value shortcut string attribute data set value ( plural res , quantity , format args ) ; return this ; }


determine the ' { @ code id } ' attribute value for this tag , autogenerating one if none specified

protected string resolve id ( ) throws jsp exception { object id = evaluate ( " id " , get id ( ) ) ; if ( id ! = null ) { string id string = id to string ( ) ; return ( string utils has text ( id string ) ? id string : null ) ; } return autogenerate id ( ) ; }


ensures parity in the performance of sequential read for version 1 and version 2 of the block blob input stream

public void test 0315 sequential read performance ( ) throws i o exception { assume huge file exists ( ) ; final int max attempts = 10 ; final double max acceptable ratio = 1 01 ; double v 1 elapsed ms = 0 , v 2 elapsed ms = 0 ; double ratio = double max value ; for ( int i = 0 ; i < max attempts & & ratio > = max acceptable ratio ; i + + ) { v 1 elapsed ms = sequential read ( 1 , account using input stream v 1 get file system ( ) , false ) ; v 2 elapsed ms = sequential read ( 2 , account using input stream v 2 get file system ( ) , false ) ; ratio = v 2 elapsed ms / v 1 elapsed ms ; log info ( string format ( " v 1 elapsed ms = % 1 $ d , v 2 elapsed ms = % 2 $ d , ratio = % 3 $ 2f " , ( long ) v 1 elapsed ms , ( long ) v 2 elapsed ms , ratio ) ) ; } assert true ( string format ( " performance of version 2 is not acceptable : v 1 elapsed ms = % 1 $ d , " + " v 2 elapsed ms = % 2 $ d , ratio = % 3 $ 2f " , ( long ) v 1 elapsed ms , ( long ) v 2 elapsed ms , ratio ) , ratio < max acceptable ratio ) ; }


public int get connect to learner master limit ( ) { return connect to learner master limit ; }


sample all the sources for a snapshot of metricstags

public synchronized metrics buffer sample metrics ( ) { collector clear ( ) ; metrics buffer builder buffer builder = new metrics buffer builder ( ) ; for ( entry < string , metrics source adapter > entry : sources entry set ( ) ) { if ( source filter = = null | | source filter accepts ( entry get key ( ) ) ) { snapshot metrics ( entry get value ( ) , buffer builder ) ; } } if ( publish self metrics ) { snapshot metrics ( sys source , buffer builder ) ; } metrics buffer buffer = buffer builder get ( ) ; return buffer ; }


public rounding params set border width ( float width ) { preconditions check argument ( width > = 0 , " the border width cannot be < 0 " ) ; m border width = width ; return this ; }


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

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


search for the register which has the specified address among register keys contained with in the reg index map

private register get register ( address addr , map < register , integer > reg index map ) { for ( register reg : reg index map key set ( ) ) { if ( reg get address ( ) equals ( addr ) ) { return reg ; } } return null ; }


creates a new { @ link async session } to issue asynchronous entity operations see { @ link async session } for details

public async session start async session ( ) { return new async session ( this ) ; }


get the count of " 0 3 0t " triads which have three unidirectional edges among the vertices , forming a closed triplet , a triangle ; two of the unidirectional edges sourcetarget the same vertex

public big integer get count 0 3 0t ( ) { return counts [ 8 ] ; }


fulfills { @ link com google devtools build lib actions abstract action # get mnemonic ( ) }


public void set up ( ) throws exception { super set up ( ) ; byte [ ] block = swift test utils dataset ( seek file len , 0 , 255 ) ; / / delete the test directory test path = path ( " / test " ) ; read file = new path ( test path , " test read past buffer txt " ) ; create file ( read file , block ) ; }


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


sets if previously persisted settings should be cleared

spdy settings frame set clear previously persisted settings ( boolean clear ) ;


forces the eviction jitter to be predictable

public static void reset thread local random ( ) { set thread local random ( random probe , random seed ) ; }


remote namenode just has started a log segment , start log segment locally

public synchronized void start log segment ( long txid , boolean abort current log segment , int layout version ) throws i o exception { log info ( " started a new log segment at txid " + txid ) ; if ( is segment open ( ) ) { if ( get last written tx id ( ) = = txid - 1 ) { / / in sync with the nn , so end and finalize the current segment ` end current log segment ( false ) ; } else { / / missed some transactions : probably lost contact with nn temporarily final string mess = " cannot start a new log segment at txid " + txid + " since only up to txid " + get last written tx id ( ) + " have been written in the log segment starting at " + get cur segment tx id ( ) + " " ; if ( abort current log segment ) { / / mark the current segment as aborted log warn ( mess ) ; abort current log segment ( ) ; } else { throw new i o exception ( mess ) ; } } } set next tx id ( txid ) ; start log segment ( txid , layout version ) ; }


used for asynchronous execution this will queue up the command and return a future to get the result once it completes

public future < response type > queue ( ) { return to observable ( ) to blocking ( ) to future ( ) ; }


adds the given { @ link simple cache span } which contains a part of the content

public void add span ( simple cache span span ) { cached spans add ( span ) ; }


return the static part of this joinpoint the static part is an accessible object on which a chain of interceptors are installed


returns a new immutable array containing the values in the specified range < b > performance note : < b > the returned array has the same full memory footprint as this one does ( no actual copying is performed ) to reduce memory usage , use { @ code sub array ( start , end ) trimmed ( ) }

public immutable long array sub array ( int start index , int end index ) { preconditions check position indexes ( start index , end index , length ( ) ) ; return start index = = end index ? empty : new immutable long array ( array , start + start index , start + end index ) ; }


sets the listener of inbound frames this listener will only be set if the decoder ' s listener is { @ code null }

protected b frame listener ( http 2 frame listener frame listener ) { this frame listener = check not null ( frame listener , " frame listener " ) ; return self ( ) ; }


after data has been inserted into the partition path , the partition may need to be created ( if doesn ' t exists ) or updated

void create or alter partition ( linked hash map < string , string > partition spec , path partition path ) throws exception ;


called once a node connection is closed and unregistered

default void on node disconnected ( discovery node node , transport connection connection ) { }


reads a timers snapshot from the provided input view

internal timers snapshot < k , n > read timers snapshot ( data input view in ) throws i o exception ;


returns the maximum value from this list of instruction offsets returns < code > integer min value < code > if the list is empty

public int maximum value ( ) { int maximum value = integer min value ; if ( values ! = null ) { for ( int index = 0 ; index < values length ; index + + ) { int value = values [ index ] ; if ( maximum value < value ) { maximum value = value ; } } } return maximum value ; }


gets the zoo keeper root node to use for this service for instance , a root node of { @ code mycompanymyservice } would be the parent of all leader offers for this service obviously all processes that wish to contend for leader status need to use the same root node note : we assume this node already exists

public string get root node name ( ) { return root node name ; }


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


bridge to controller method - level annotations

public < a extends annotation > boolean has method annotation ( class < a > annotation type ) { return servlet invocable handler method this has method annotation ( annotation type ) ; }


return the set of properties marked as required but not present upon validation

public set < string > get missing required properties ( ) { return this missing required properties ; }


processes the dyld cache ' s dylib files this will mark up the dylib files , added them to the program tree , and make memory blocks for them

private void process dylibs ( ) throws exception { / / create an " info " object for each dyld cache dylib , which will make processing them / / easier monitor set message ( " parsing dylib ' s " ) ; monitor initialize ( dyld cache header get image infos ( ) size ( ) ) ; tree set < dyld cache macho info > info set = new tree set < > ( ( a , b ) - > a header addr compare to ( b header addr ) ) ; for ( dyld cache image info dyld cache image info : dyld cache header get image infos ( ) ) { info set add ( new dyld cache macho info ( provider , dyld cache image info get address ( ) - dyld cache header get base address ( ) , space get address ( dyld cache image info get address ( ) ) , dyld cache image info get path ( ) ) ) ; monitor check canceled ( ) ; monitor increment progress ( 1 ) ; } / / markup dyld cache mach - o headers monitor set message ( " marking up dylib headers " ) ; monitor initialize ( info set size ( ) ) ; for ( dyld cache macho info info : info set ) { info markup headers ( ) ; monitor check canceled ( ) ; monitor increment progress ( 1 ) ; } / / add dyld cache mach - o ' s to program tree monitor set message ( " adding dylib ' s to program tree " ) ; monitor initialize ( info set size ( ) ) ; iterator < dyld cache macho info > iter = info set iterator ( ) ; if ( iter has next ( ) ) { dyld cache macho info curr = iter next ( ) ; do { dyld cache macho info next = iter has next ( ) ? iter next ( ) : null ; curr add to program tree ( next ) ; curr = next ; monitor check canceled ( ) ; monitor increment progress ( 1 ) ; } while ( iter has next ( ) ) ; } / / process dyld cache dylib memory blocks monitor set message ( " processing dylib memory blocks " ) ; monitor initialize ( info set size ( ) ) ; for ( dyld cache macho info info : info set ) { info process memory blocks ( ) ; monitor check canceled ( ) ; monitor increment progress ( 1 ) ; } }


called after a plugin has been downloaded to move it into its final location the default implementation is a file rename

public void install ( download job job , file src , file dst ) throws i o exception { job replace ( dst , src ) ; }


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

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


in the following test , we add a write request followed by several read requests of the same session , and we verify several things - 1 the write is not processed until commit arrives 2 once the write is processed , all the read requests are processed as well 3 all read requests are executed after the write , before any other write , along with new reads

public void process all following uncommitted after first commit test ( ) throws exception { final string path = " / test uncommitted following commited " ; set < request > should be in pending = new hash set < request > ( ) ; set < request > should be processed after pending = new hash set < request > ( ) ; request write req = new request ( new create request ( path , new byte [ 0 ] , ids open acl unsafe , create mode persistent sequential to flag ( ) ) , op code create , 0x 1 , 1 ) ; processor queued requests add ( write req ) ; processor queued write requests add ( write req ) ; should be in pending add ( write req ) ; for ( int read req id = 2 ; read req id < = 5 ; + + read req id ) { request read req = new request ( new get data request ( path , false ) , op code get data , 0x 1 , read req id ) ; processor queued requests add ( read req ) ; should be in pending add ( read req ) ; should be processed after pending add ( read req ) ; } processor init threads ( default size of thread pool ) ; processor stopped main loop = true ; processor run ( ) ; assert true ( processed requests is empty ( ) , " processed without waiting for commit " ) ; assert true ( processor queued requests is empty ( ) , " did not handled all of queued requests ' requests " ) ; assert true ( ! processor queued write requests is empty ( ) , " removed from blocked queued requests before commit " ) ; should be in pending remove all ( processor pending requests get ( write req session id ) ) ; for ( request r : should be in pending ) { log error ( " should be in pending { } " , r ) ; } assert true ( should be in pending is empty ( ) , " not all requests moved to pending from queued requests " ) ; processor committed requests add ( write req ) ; processor stopped main loop = true ; processor run ( ) ; processor init threads ( default size of thread pool ) ; thread sleep ( 500 ) ; assert true ( processed requests peek ( ) = = write req , " did not process committed request " ) ; assert true ( processed requests contains all ( should be processed after pending ) , " did not process following read request " ) ; assert true ( processor committed requests is empty ( ) , " did not process committed request " ) ; assert true ( processor pending requests is empty ( ) , " did not process committed request " ) ; assert true ( processor queued write requests is empty ( ) , " did not remove from blocked queued requests " ) ; }


a meaningless value used to test that plugin suggesters can add fields to their suggestion types this can ' t be serialized to xcontent because suggestions appear in xcontent as an array of entries , so there is no place to add a custom field but we can still use a custom field internally and use it to define a suggestion ' s behavior

public string get dummy ( ) { return dummy ; }


public void set host ( string host ) { this host = host ; }


public void execute ( command line cmd ) throws exception { log info ( " executing \ " query plan \ " command " ) ; preconditions check state ( cmd has option ( disk balancer c l i query ) ) ; verify command options ( disk balancer c l i query , cmd ) ; string node name = cmd get option value ( disk balancer c l i query ) ; preconditions check not null ( node name ) ; node name = node name trim ( ) ; string node address = node name ; / / if the string is not name : port format use the default port if ( ! node name matches ( " [ ^ \ \ : ] + : [ 0 - 9 ] { 2 , 5 } " ) ) { int default i p c = net utils create socket addr ( get conf ( ) get trimmed ( d f s config keys dfs datanode ipc address key , d f s config keys dfs datanode ipc address default ) ) get port ( ) ; node address = node name + " : " + default i p c ; log debug ( " using default data node port : { } " , node address ) ; } client datanode protocol data node = get data node proxy ( node address ) ; try { disk balancer work status work status = data node query disk balancer plan ( ) ; system out printf ( " plan file : % s % n plan id : % s % n result : % s % n " , work status get plan file ( ) , work status get plan i d ( ) , work status get result ( ) to string ( ) ) ; if ( cmd has option ( disk balancer c l i verbose ) ) { system out printf ( " % s " , work status current state string ( ) ) ; } } catch ( disk balancer exception ex ) { log error ( " query plan failed ex : { } " , ex ) ; throw ex ; } }


once the { @ link event dispatcher } is initialised , handlers related to specific events have to be made known to the dispatcher by registering them in this case the { @ link user created event } is bound to the user created event handler , whilst the { @ link user updated event } is bound to the { @ link user updated event handler } the dispatcher can now be called to dispatch specific events when a user is saved , the { @ link user created event } can be dispatched on the other hand , when a user is updated , { @ link user updated event } can be dispatched

public static void main ( string [ ] args ) { var dispatcher = new event dispatcher ( ) ; dispatcher register handler ( user created event class , new user created event handler ( ) ) ; dispatcher register handler ( user updated event class , new user updated event handler ( ) ) ; var user = new user ( " iluwatar " ) ; dispatcher dispatch ( new user created event ( user ) ) ; dispatcher dispatch ( new user updated event ( user ) ) ; }


patch fake classname test : to test class name in snake case to test class name in snake case

default response entity < client > test classname ( @ api param ( value = " client model " , required = true ) @ valid @ request body client body ) { get request ( ) if present ( request - > { for ( media type media type : media type parse media types ( request get header ( " accept " ) ) ) { if ( media type is compatible with ( media type value of ( " application / json " ) ) ) { string example string = " { \ " client \ " : \ " client \ " } " ; api util set example response ( request , " application / json " , example string ) ; break ; } } } ) ; return new response entity < > ( http status not implemented ) ; }


gets a new target address from the untried target list if it can find one not already in the disassembled address set that is passed in

private address get next target ( address set body , array list < address > untried target list ) { address new target = null ; / / no new target , try to get it from the target list if ( ! untried target list is empty ( ) ) { iterator < address > iter = untried target list iterator ( ) ; while ( iter has next ( ) ) { address possible target = iter next ( ) ; if ( ! body contains ( possible target ) ) { new target = possible target ; iter remove ( ) ; break ; } } } return new target ; }


sets the node ' s value and adds it to the heap the node should not already be in the heap

public t add ( t node , float value ) { node value = value ; return add ( node ) ; }


resolves { @ code bind hosts } to a list of internet addresses the list will not contain duplicate addresses

public inet address [ ] resolve bind host addresses ( string bind hosts [ ] ) throws i o exception { if ( bind hosts = = null | | bind hosts length = = 0 ) { for ( custom name resolver custom name resolver : custom name resolvers ) { inet address addresses [ ] = custom name resolver resolve default ( ) ; if ( addresses ! = null ) { return addresses ; } } / / we know it ' s not here get the defaults bind hosts = new string [ ] { " local " } ; } inet address addresses [ ] = resolve inet addresses ( bind hosts ) ; / / try to deal with some ( mis ) configuration for ( inet address address : addresses ) { / / check if its multicast : flat out mistake if ( address is multicast address ( ) ) { throw new illegal argument exception ( " bind address : { " + network address format ( address ) + " } is invalid : multicast address " ) ; } / / check if its a wildcard address : this is only ok if its the only address ! if ( address is any local address ( ) & & addresses length > 1 ) { throw new illegal argument exception ( " bind address : { " + network address format ( address ) + " } is wildcard , but multiple addresses specified : this makes no sense " ) ; } } return addresses ; }


put a guid into the byte array the guid is represented by the standard arguments used , and these are accepted as arguments to this method

public void put g u i d ( int data 1 , short data 2 , short data 3 , byte [ ] data 4 ) { if ( data 4 length ! = 8 ) { string msg = " guid invalid byte [ ] size terminating " ; msg error ( this , msg ) ; throw new assert exception ( msg ) ; } put int ( data 1 ) ; put short ( data 2 ) ; put short ( data 3 ) ; put bytes ( data 4 ) ; }


add all providers from another list to this one

public void add all ( a w s credential provider list other ) { providers add all ( other providers ) ; }


applies the rotation by the given angle around the given axis to the current transformation matrix of each controller

public void rotate ( vector 3 axis , float angle ) { for ( int i = 0 , n = controllers size ; i < n ; i + + ) controllers get ( i ) rotate ( axis , angle ) ; }


public static long crc 3 2 ( byte [ ] bytes ) { return crc 3 2 ( bytes , 0 , bytes length ) ; }


sets image bitmap into this image aware view < br > displays loaded and decoded image { @ link android graphics bitmap } in this image view aware actually it ' s used only in { @ link com nostra 1 3 universalimageloader core display bitmap displayer bitmap displayer } < br > is called on ui thread if image loader was called on ui thread otherwise - on background thread

boolean set image bitmap ( bitmap bitmap ) ;


the number of symbols field is stored in big - endian format

private int read number of symbols ( binary reader reader ) throws i o exception { if ( reader is little endian ( ) ) { data converter dc = big endian data converter instance ; byte [ ] bytes = reader read next byte array ( 4 ) ; return dc get int ( bytes ) ; } return reader read next int ( ) ; }


this method is copied from calcite , and modify it to not rely on function todo flink table function need implement get element type

private static object [ ] convert arguments ( list < rel data type > operand types , list < object > arguments 0 ) { list < object > arguments = new array list < > ( arguments 0 size ( ) ) ; / / construct a list of arguments , if they are all constants for ( pair < rel data type , object > pair : pair zip ( operand types , arguments 0 ) ) { arguments add ( coerce ( pair right , pair left ) ) ; } return arguments to array ( ) ; }


this is the lto indexing step , rather than the real link when using this , build ( ) will store all lto artifacts as a side - effect so the next build ( ) call can emit the real link do not call add input ( ) between the two build ( ) calls

public cpp link action builder set lto indexing ( boolean lto indexing ) { this is lto indexing = lto indexing ; return this ; }


marks this node and all ancestors as invalid and needing to be rebuilt

void invalidate ( ) { invalid = true ; if ( parent ! = null ) { parent invalidate ( ) ; } }


statistics about the memory usage : minimum , maximum , average and total

public simple stats get memory stats ( ) { return memory stats ; }


returns a { @ code byte sink } that writes base - encoded bytes to the specified { @ code char sink }

public final byte sink encoding sink ( final char sink encoded sink ) { check not null ( encoded sink ) ; return new byte sink ( ) { @ override public output stream open stream ( ) throws i o exception { return encoding stream ( encoded sink open stream ( ) ) ; } } ; }


each value in the exception index table array must be a valid index into the constant pool table the constant pool entry referenced by each table item must be a constant class info structure representing a class type that this method is declared to throw

public int get exception index table entry ( int i ) { return exception index table [ i ] & 0xffff ; }


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


this constraint generalizes the cardinality and target constraints consider a set of nodes n that belongs to the scope specified in the constraint if the target expressions are satisfied at least min cardinality times and at most max cardinality times in the node set n , then the constraint is satisfied for example , { @ code target cardinality ( rack , 2 , 10 , allocation tag ( " zk " ) ) } , requires an allocation to be placed within a rack that has at least 2 and at most 10 other allocations with tag " zk "

public static abstract constraint target cardinality ( string scope , int min cardinality , int max cardinality , target expression target expressions ) { return new single constraint ( scope , min cardinality , max cardinality , target expressions ) ; }


resolve a value for the { @ link parameter } in the supplied { @ link parameter context } by retrieving the corresponding dependency from the test ' s { @ link application context } delegates to { @ link parameter resolution delegate # resolve dependency }

public object resolve parameter ( parameter context parameter context , extension context extension context ) { parameter parameter = parameter context get parameter ( ) ; int index = parameter context get index ( ) ; class < ? > test class = extension context get required test class ( ) ; application context application context = get application context ( extension context ) ; return parameter resolution delegate resolve dependency ( parameter , index , test class , application context get autowire capable bean factory ( ) ) ; }


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


builds a uuid by repeating the given number n for valid n , it is guaranteed that the returned u u i ds satisfy the same relation relative to others as their parameter n does : iff n < m , then uuid for int ( n ) < uuid for int ( m )

public static uuid uuid for int ( final int n ) { return new uuid ( 0 , n ) ; }


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


public void test gm fruit ( ) { / / todo : test gm fruit }


register an initial value for the currently deserializing value , for use by child objects that may have references to it this is a noop when memoization is disabled

public < t > void register initial value ( t initial value ) { if ( deserializer = = null ) { return ; } deserializer register initial value ( initial value ) ; }


optional identification of the kind of scm being used

public string get kind ( ) { return null ; }


private boolean scan directory tree ( final path path , final dir marker tracker tracker , final int limit ) throws i o exception { int count = 0 ; boolean result = true ; remote iterator < s 3 a file status > listing = operations list objects ( path , store context path to key ( path ) ) ; while ( listing has next ( ) ) { count + + ; s 3 a file status status = listing next ( ) ; path status path = status get path ( ) ; s 3 a located file status located status = new s 3 a located file status ( status , null ) ; string key = store context path to key ( status path ) ; if ( status is directory ( ) ) { if ( verbose ) { println ( out , " directory marker % s / " , key ) ; } log debug ( " { } " , key ) ; tracker marker found ( status path , key + " / " , located status ) ; } else { tracker file found ( status path , key , located status ) ; } if ( ( count % 1000 ) = = 0 ) { println ( out , " scanned % , d objects " , count ) ; } if ( limit > 0 & & count > = limit ) { println ( out , " limit of scan reached - % , d object % s " , limit , suffix ( limit ) ) ; result = false ; break ; } } log debug ( " listing summary { } " , listing ) ; if ( verbose ) { println ( out , " % n listing statistics : % n % s % n " , io statistics source to string ( listing ) ) ; } return result ; }


calls { @ link memoizing evaluator # evaluate } on the given { @ link skyframe executor } ' s graph

public static < t extends sky value > evaluation result < t > evaluate ( skyframe executor skyframe executor , sky key key , boolean keep going , extended event handler error event listener ) throws interrupted exception { evaluation context evaluation context = evaluation context new builder ( ) set keep going ( keep going ) set num threads ( skyframe executor default thread count ) set event handler ( error event listener ) build ( ) ; return skyframe executor get driver ( ) evaluate ( immutable list of ( key ) , evaluation context ) ; }


creates get api key request for given api key name

public static get api key request using api key name ( string api key name , boolean owned by authenticated user ) { return new get api key request ( null , null , null , api key name , owned by authenticated user ) ; }


returns a method name from the { @ code android content res resources } class for array resource binding , null if the element type is not supported

private static @ nullable field resource binding type get array resource method name ( element element ) { type mirror type mirror = element as type ( ) ; if ( typed array type equals ( type mirror to string ( ) ) ) { return field resource binding type typed array ; } if ( type kind array equals ( type mirror get kind ( ) ) ) { array type array type = ( array type ) type mirror ; string component type = array type get component type ( ) to string ( ) ; if ( string type equals ( component type ) ) { return field resource binding type string array ; } else if ( " int " equals ( component type ) ) { return field resource binding type int array ; } else if ( " java lang char sequence " equals ( component type ) ) { return field resource binding type text array ; } } return null ; }


get the value of the < code > name < code > property as an < code > int < code > if no such property exists , the provided default value is returned , or if the specified value is not a valid < code > int < code > , then an error is thrown

public int get int ( string name , int default value ) { string value string = get trimmed ( name ) ; if ( value string = = null ) return default value ; string hex string = get hex digits ( value string ) ; if ( hex string ! = null ) { return integer parse int ( hex string , 16 ) ; } return integer parse int ( value string ) ; }


public int hash code ( ) { return path ! = null ? path hash code ( ) : 0 ; }


base class definition for whether the ip should be checked or not ; overridable

protected boolean ip pattern can be checked ( final string remote ip ) { return this ips to check pattern ! = null & & string utils is not blank ( remote ip ) ; }


returns a descriptive log string for the given { @ code status code } , or " unknown " if not one of { @ link cast status codes }

public static string get log string ( int status code ) { switch ( status code ) { case cast status codes application not found : return " a requested application could not be found " ; case cast status codes application not running : return " a requested application is not currently running " ; case cast status codes authentication failed : return " authentication failure " ; case cast status codes canceled : return " an in - progress request has been canceled , most likely because another action has " + " preempted it " ; case cast status codes error service creation failed : return " the cast remote display service could not be created " ; case cast status codes error service disconnected : return " the cast remote display service was disconnected " ; case cast status codes failed : return " the in - progress request failed " ; case cast status codes internal error : return " an internal error has occurred " ; case cast status codes interrupted : return " a blocking call was interrupted while waiting and did not run to completion " ; case cast status codes invalid request : return " an invalid request was made " ; case cast status codes message send buffer too full : return " a message could not be sent because there is not enough room in the send buffer at " + " this time " ; case cast status codes message too large : return " a message could not be sent because it is too large " ; case cast status codes network error : return " network i / o error " ; case cast status codes not allowed : return " the request was disallowed and could not be completed " ; case cast status codes replaced : return " the request ' s progress is no longer being tracked because another request of the " + " same type has been made before the first request completed " ; case cast status codes success : return " success " ; case cast status codes timeout : return " an operation has timed out " ; case cast status codes unknown error : return " an unknown , unexpected error has occurred " ; default : return cast status codes get status code string ( status code ) ; } }


returns a { @ link workspace name value } for a workspace with the given name

public static workspace name value with name ( string workspace name ) { return new workspace name value ( preconditions check not null ( workspace name ) ) ; }


check that the java process running inside the container has the expected uid , gid and username

public void test 1 3 0 java has correct ownership ( ) { final process info info = process info get process info ( sh , " java " ) ; assert that ( " incorrect uid " , info uid , equal to ( 1000 ) ) ; assert that ( " incorrect username " , info username , equal to ( " elasticsearch " ) ) ; assert that ( " incorrect gid " , info gid , equal to ( 0 ) ) ; assert that ( " incorrect group " , info group , equal to ( " root " ) ) ; }


creates a { @ link remote stream environment } the remote environment sends ( parts of ) the program to a cluster for execution note that all file paths used in the program must be accessible from the cluster the execution will use the specified parallelism

public static stream execution environment create remote environment ( string host , int port , configuration client config , string jar files ) { return new remote stream environment ( host , port , client config , jar files ) ; }


returns the validation errors accumulated

public final list < string > validation errors ( ) { return validation errors ; }


adds relationship where the current object is the foreign key table in a relationship

public void add association ( e r d association rel , boolean reflect ) { if ( associations = = null ) { associations = new array list < > ( ) ; } associations add ( rel ) ; if ( reflect ) { fire property change ( output , null , rel ) ; } }


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


void print stack trace ( exception ex ) ;


void valid session ( boolean valid session ) { this valid session = valid session ; }


get update one row statement by condition fields , default not use limit 1 , because limit 1 is a sql dialect

default string get update statement ( string table name , string [ ] field names , string [ ] condition fields ) { string set clause = arrays stream ( field names ) map ( f - > format ( " % s = : % s " , quote identifier ( f ) , f ) ) collect ( collectors joining ( " , " ) ) ; string condition clause = arrays stream ( condition fields ) map ( f - > format ( " % s = : % s " , quote identifier ( f ) , f ) ) collect ( collectors joining ( " and " ) ) ; return " update " + quote identifier ( table name ) + " set " + set clause + " where " + condition clause ; }


configures { @ link # bind ( ) } to use the specified { @ code tex id } for this sampler uniform

public void set sampler tex id ( int tex id , int unit ) { this tex id = tex id ; this unit = unit ; }


returns an unmodifiable set of all row key column key value triplets changes to the table will update the returned set the returned set ' s iterator traverses the mappings with the first row key , the mappings with the second row key , and so on the value in the returned cells may change if the table subsequently changes

public set < cell < r , c , v > > cell set ( ) { return super cell set ( ) ; }


whether the given { @ linkplain method parameter method parameter } is supported by any registered { @ link handler method argument resolver }

public boolean supports parameter ( method parameter parameter ) { return get argument resolver ( parameter ) ! = null ; }


this covers a bug where listener healthy would get called when a single service failed during startup ( it occurred in more complicated cases also )

public void test fail start single service calls healthy ( ) { service a = new fail start service ( ) ; service manager manager = new service manager ( as list ( a ) ) ; recording listener listener = new recording listener ( ) ; manager add listener ( listener , direct executor ( ) ) ; try { manager start async ( ) await healthy ( ) ; fail ( ) ; } catch ( illegal state exception expected ) { } assert false ( listener healthy called ) ; }