create a < code > categorization analyzer < code > that mimics what the tokenizer and filters built into the ml c + + code do this is the default analyzer for categorization to ensure that people upgrading from previous versions get the same behaviour from their categorization jobs before and after upgrade

public static categorization analyzer config build default categorization analyzer ( list < string > categorization filters ) { categorization analyzer config builder builder = new categorization analyzer config builder ( ) ; if ( categorization filters ! = null ) { for ( string categorization filter : categorization filters ) { map < string , object > char filter = new hash map < > ( ) ; char filter put ( " type " , " pattern replace " ) ; char filter put ( " pattern " , categorization filter ) ; builder add char filter ( char filter ) ; } } builder set tokenizer ( " ml classic " ) ; map < string , object > token filter = new hash map < > ( ) ; token filter put ( " type " , " stop " ) ; token filter put ( " stopwords " , arrays as list ( " monday " , " tuesday " , " wednesday " , " thursday " , " friday " , " saturday " , " sunday " , " mon " , " tue " , " wed " , " thu " , " fri " , " sat " , " sun " , " january " , " february " , " march " , " april " , " may " , " june " , " july " , " august " , " september " , " october " , " november " , " december " , " jan " , " feb " , " mar " , " apr " , " may " , " jun " , " jul " , " aug " , " sep " , " oct " , " nov " , " dec " , " gmt " , " utc " ) ) ; builder add token filter ( token filter ) ; return builder build ( ) ; }


return the sum of this vector and another ; does not alter either one

public final vec 2 add ( vec 2 v ) { return new vec 2 ( x + v x , y + v y ) ; }


public int get previous offset ( ) { return - 1 ; }


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

t visit identifier ( sql base parser identifier context ctx ) ;


the cost function used to calculate costs of a sub set of devices it calculate link weight of each pair in non - duplicated combination of devices

public int compute cost of devices ( device [ ] devices ) { int cost = 0 ; string gpu index 0 ; string gpu index 1 ; for ( int i = 0 ; i < devices length ; i + + ) { gpu index 0 = string value of ( devices [ i ] get minor number ( ) ) ; for ( int j = i + 1 ; j < devices length ; j + + ) { gpu index 1 = string value of ( devices [ j ] get minor number ( ) ) ; cost + = this device pair to weight get ( gpu index 0 + " - " + gpu index 1 ) ; } } return cost ; }


public int get tick time ( ) { return tick time ; }


the manager ( merge resolver ) for a particular merge phase should call this when its phase or sub - phase begins the string array should match one that the returned by merge resolver get phases ( )

public void set in progress ( string [ ] merge phase ) { merge progress panel set in progress ( merge phase ) ; }


applies { @ link json path expectations helper # assert value ( string , object ) }

public web test client body content spec is equal to ( object expected value ) { this path helper assert value ( this content , expected value ) ; return this body spec ; }


an overloaded variant of { @ link # value ( matcher ) } that also accepts a target type for the resulting value that the matcher can work reliably against this can be useful for matching numbers reliably & mdash ; for example , to coerce an integer into a double

public < t > result matcher value ( matcher < ? super t > matcher , class < t > target type ) { return result - > this json path helper assert value ( get content ( result ) , matcher , target type ) ; }


get petfind by tags : finds pets by tags multiple tags can be provided with comma separated strings use tag 1 , tag 2 , tag 3 for testing

response entity < list < pet > > find pets by tags ( list < string > tags , final pageable pageable ) ;


appends the { @ link pem encoded } value to the { @ link byte buf } ( last arg ) and returns it if the { @ link byte buf } didn ' t exist yet it ' ll create it using the { @ link byte buf allocator }

private static byte buf append ( byte buf allocator allocator , boolean use direct , pem encoded encoded , int count , byte buf pem ) { byte buf content = encoded content ( ) ; if ( pem = = null ) { / / see the other append ( ) method pem = new buffer ( allocator , use direct , content readable bytes ( ) * count ) ; } pem write bytes ( content slice ( ) ) ; return pem ; }


display a modal task dialog associated with this locking task this method will not return until the task has completed and the lock has been released

void wait for task completion ( ) { synchronized ( this ) { if ( dobj = = null ) { return ; } if ( task dialog = = null ) { task dialog = new my task dialog ( ) ; } else { try { / / dialog already displayed - wait for release lock to occur wait ( ) ; } catch ( interrupted exception e ) { / / ignore } return ; } } / / show dialog without synchronization my task dialog dialog = task dialog ; if ( dialog ! = null ) { system utilities run swing now ( ( ) - > dialog show ( 0 ) ) ; } }


creates a new { @ link recovery state } per shard this method is called once per shard on shard creation

recovery state new recovery state ( shard routing shard routing , discovery node target node , @ nullable discovery node source node ) ;


find the fields constant that matches name , or null if its not found

public static fields find by name ( string name ) { return by name get ( name ) ; }


create a directory if needed , force it to be authoritatively listed

private void mk auth dir ( path path ) throws i o exception { auth f s mkdirs ( path ) ; }


group the records by their current key into a { @ link k grouped stream } while preserving the original values and default serializers and deserializers { @ link k grouped stream } can be further grouped with other streams to form a { @ link cogrouped k stream } grouping a stream on the record key is required before an aggregation operator can be applied to the data ( cf { @ link k grouped stream } ) if a record key is { @ code null } the record will not be included in the resulting { @ link k grouped stream } if a key changing operator was used before this operation ( e g , { @ link # select key ( key value mapper ) } , { @ link # map ( key value mapper ) } , { @ link # flat map ( key value mapper ) } or { @ link # transform ( transformer supplier , string ) } ) an internal repartitioning topic may need to be created in kafka if a later operator depends on the newly selected key this topic will be named " $ { application id } - & lt ; name & gt ; - repartition " , where " application id " is user - specified in { @ link streams config } via parameter { @ link streams config # application id config application id config } , " & lt ; name & gt ; " is an internally generated name , and " - repartition " is a fixed suffix you can retrieve all generated internal topic names via { @ link topology # describe ( ) } for this case , all data of this stream will be redistributed through the repartitioning topic by writing all records to it , and rereading all records from it , such that the resulting { @ link k grouped stream } is partitioned correctly on its key if the last key changing operator changed the key type , it is recommended to use { @ link # group by key ( org apache kafka streams kstream grouped ) } instead

k grouped stream < k , v > group by key ( ) ;


converts from a map to features < supported version range >

public static features < supported version range > from supported features map ( map < string , map < string , short > > features map ) { return from features map ( features map , supported version range : : from map ) ; }


it first processes the wait time , if there is any , and then invokes { @ link # process retry info ( ) } if the wait time is positive , it either sleeps for synchronous calls or immediately returns for asynchronous calls

call return process wait time and retry info ( ) throws interrupted i o exception { final long wait time = get wait time ( time monotonic now ( ) ) ; log trace ( " # { } process retry info : retry info = { } , wait time = { } " , call id , retry info , wait time ) ; if ( wait time ! = null & & wait time > 0 ) { try { thread sleep ( retry info delay ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; if ( log is debug enabled ( ) ) { log debug ( " interrupted while waiting to retry " , e ) ; } interrupted i o exception int i o e = new interrupted i o exception ( " retry interrupted " ) ; int i o e init cause ( e ) ; throw int i o e ; } } process retry info ( ) ; return call return retry ; }


reads an 8 - bit value from < code > program < code > at < code > addr < code >

protected static long read byte ( program program , address addr ) throws memory access exception { return program get memory ( ) get byte ( addr ) ; }


creates a { @ code test subscriber } with the given initial request amount

public static < t > test subscriber < t > create ( long initial requested ) { return new test subscriber < > ( initial requested ) ; }


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


returns the number of { @ link data } objects for the current action context


visible for serialization deserialization do not use this method ; use { @ link # equals }

public long get c time ( ) { return ctime ; }


public void set num return instructions ( int return instructions ) { this num return instructions = return instructions ; }


sets the negotiation type for the http2 connection if tls is enabled a default { @ link s s l socket factory } is created using the best { @ link java security provider } available and is not based on { @ link s s l socket factory # get default } to more precisely control the tls configuration call { @ link # ssl socket factory } to override the socket factory used default : < code > tls < code >

public ok http channel builder negotiation type ( io grpc okhttp negotiation type type ) { preconditions check state ( ! freeze security configuration , " cannot change security when using channel credentials " ) ; preconditions check not null ( type , " type " ) ; switch ( type ) { case tls : negotiation type = negotiation type tls ; break ; case plaintext : negotiation type = negotiation type plaintext ; break ; default : throw new assertion error ( " unknown negotiation type : " + type ) ; } return this ; }


desugar the classes that are in the inputs specified in the command line arguments

private void desugar classes in input ( input file provider input files , output file provider output file provider , class loader loader , @ nullable class reader factory classpath reader , dependency collector deps collector , class reader factory bootclasspath reader , @ nullable core library support core library support , class vs interface interface cache , immutable set builder < string > interface lambda method collector , invocation site transformation record builder call site record , boot class path digest boot class path digest , class attribute record class attribute record , nest digest nest digest , immutable set builder < class name > required runtime support types , class member retarget config class member retarget config ) throws i o exception { for ( file content provider < ? extends input stream > input file provider : iterables concat ( input files to input file streams ( ) , nest digest get companion file providers ( ) ) ) { string input filename = input file provider get binary path name ( ) ; if ( " module - info class " equals ( input filename ) | | input filename starts with ( " meta - inf / versions / " ) ) { continue ; / / drop module - info class and meta - inf / versions / since d 8 will drop them anyway } if ( output file provider desugar deps filename equals ( input filename ) ) { / / todo ( kmb ) : rule out that this happens or merge input file with what ' s in deps collector continue ; / / skip as we ' re writing a new file like this at the end or don ' t want it } try ( input stream content = input file provider get ( ) ) { / / we can write classes uncompressed since they need to be converted to dex format / / for android anyways resources are written as they were in the input jar to avoid / / any danger of accidentally uncompressed resources ending up in an apk we also simply / / copy classes from desugar ' s runtime library , which we build so they need no desugaring / / the runtime library typically uses constructs we ' d otherwise desugar , so it ' s easier / / to just skip it should it appear as a regular input ( for idempotency ) if ( input filename ends with ( " class " ) & & class name from class file name ( input filename ) is desugar eligible ( ) ) { class reader reader = rewriter reader ( content ) ; unprefixing class writer writer = rewriter writer ( class writer compute maxs ) ; class visitor visitor = create class visitors for classes in inputs ( loader , classpath reader , deps collector , bootclasspath reader , core library support , interface cache , interface lambda method collector , writer , reader , nest digest , call site record , boot class path digest , class attribute record , required runtime support types , class member retarget config ) ; if ( writer = = visitor ) { / / just copy the input if there are no rewritings output file provider write ( input filename , reader b ) ; } else { reader accept ( visitor , custom attributes , class reader expand frames ) ; string filename = writer get class name ( ) + " class " ; check state ( ( options core library & & core library support ! = null ) | | filename equals ( input filename ) ) ; output file provider write ( filename , writer to byte array ( ) ) ; } } else { / / most other files ( and directories ) we want to just copy , but string output filename = input filename ; if ( options core library & & core library support ! = null & & input filename ends with ( " / " ) ) { / / rename core library directories together with files in them output filename = core library support rename core library ( input filename ) ; } else if ( core library support ! = null & & ! input filename ends with ( " / " ) & & input filename starts with ( " meta - inf / services / " ) ) { / / rename j u service loader files for renamed core libraries so they ' re found string service name = input filename substring ( " meta - inf / services / " length ( ) ) ; if ( ! service name contains ( " / " ) & & core library support is renamed core library ( service name replace ( ' ' , ' / ' ) ) ) { output filename = " meta - inf / services / " + core library support rename core library ( service name replace ( ' ' , ' / ' ) ) replace ( ' / ' , ' ' ) ; } } output file provider copy from ( input filename , input files , output filename ) ; } } } }


public string resolve interface class name ( ) { class interface class = null ; / / first , try to get the value from " interface name " attribute string interface name = resolve attribute ( " interface name " ) ; if ( is empty ( interface name ) ) { / / if not found , try " interface class " interface class = resolve attribute ( " interface class " ) ; } else { interface class = resolve class ( interface name , get class ( ) get class loader ( ) ) ; } if ( is generic class ( interface class ) ) { interface name = interface class get name ( ) ; } else { interface name = null ; } if ( is empty ( interface name ) ) { / / if not fund , try to get the first interface from the service type class [ ] interfaces = service type get interfaces ( ) ; if ( is not empty ( interfaces ) ) { interface name = interfaces [ 0 ] get name ( ) ; } } return interface name ; }


sets a threshold that enforces a pre - filter roundtrip to pre - filter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold this filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie if date filters are mandatory to match but the shard bounds and the query are disjoint when unspecified , the pre - filter phase is executed if any of these conditions is met : the request targets more than 128 shards the request targets one or more read - only index the primary sort of the query targets an indexed field

public search request builder set pre filter shard size ( int pre filter shard size ) { this request set pre filter shard size ( pre filter shard size ) ; return this ; }


creates a { @ link scheduled executor service } whose { @ code submit } and { @ code invoke all } methods submit { @ link listenable future task } instances to the given delegate executor those methods , as well as { @ code execute } and { @ code invoke any } , are implemented in terms of calls to { @ code delegate execute } all other methods are forwarded unchanged to the delegate this implies that the returned { @ code listening scheduled executor service } never calls the delegate ' s { @ code submit } , { @ code invoke all } , and { @ code invoke any } methods , so any special handling of tasks must be implemented in the delegate ' s { @ code execute } method or by wrapping the returned { @ code listening scheduled executor service } if the delegate executor was already an instance of { @ code listening scheduled executor service } , it is returned untouched , and the rest of this documentation does not apply

public static listening scheduled executor service listening decorator ( scheduled executor service delegate ) { return ( delegate instanceof listening scheduled executor service ) ? ( listening scheduled executor service ) delegate : new scheduled listening decorator ( delegate ) ; }


public int get window size ( ) { return window size ; }


closes the stream ignoring { @ link i o exception } must only be called in cleaning up from exception handlers

public static void close stream ( final java io closeable stream ) { cleanup ( null , stream ) ; }


sets this matrix to a translation matrix , overwriting it first by an identity matrix and then setting the 4th column to the translation vector

public matrix 4 set to translation ( vector 3 vector ) { idt ( ) ; val [ m03 ] = vector x ; val [ m13 ] = vector y ; val [ m23 ] = vector z ; return this ; }


sets the starting x position for the fields generated by this factory

public void set start x ( int x ) { start x = x ; }


the opposite of { @ link # is idle ( ) } & mdash ; the executor is doing some work

public boolean is busy ( ) { lock read lock ( ) lock ( ) ; try { return work unit ! = null | | executable ! = null ; } finally { lock read lock ( ) unlock ( ) ; } }


sort { @ link extension component } s in the descending order of { @ link # ordinal ( ) }

public int compare to ( extension component < t > that ) { double a = this ordinal ( ) ; double b = that ordinal ( ) ; if ( double compare ( a , b ) > 0 ) return - 1 ; if ( double compare ( a , b ) < 0 ) return 1 ; boolean this is descriptor = false ; string this label = this instance get class ( ) get name ( ) ; if ( this instance instanceof descriptor ) { try { this label = util fix null ( ( ( descriptor ) this instance ) get display name ( ) ) ; this is descriptor = true ; } catch ( runtime exception | linkage error x ) { log log ( level warning , " failure during descriptor # get display name for " + this instance get class ( ) get name ( ) , x ) ; } } boolean that is descriptor = false ; string that label = that instance get class ( ) get name ( ) ; if ( that instance instanceof descriptor ) { try { that label = util fix null ( ( ( descriptor ) that instance ) get display name ( ) ) ; that is descriptor = true ; } catch ( runtime exception | linkage error x ) { log log ( level warning , " failure during descriptor # get display name for " + that instance get class ( ) get name ( ) , x ) ; } } if ( this is descriptor ) { if ( that is descriptor ) { return this label compare to ( that label ) ; } else { return 1 ; } } else { if ( that is descriptor ) { return - 1 ; } } return this label compare to ( that label ) ; }


returns an existing match that best correlates to the implied match ; returns null if no existing match can be found

public static v t match resolve implied match ( v t implied match info implied match , v t session session ) { v t association manager association manager = session get association manager ( ) ; address source address = implied match get source address ( ) ; address destination address = implied match get destination address ( ) ; v t association existing association = association manager get association ( source address , destination address ) ; if ( existing association ! = null ) { v t match best match = get best match ( existing association , session ) ; return best match ; } return null ; }


to test the collection format in query parameters

public api response < void > test query parameter collection format with http info ( list < string > pipe , list < string > ioutil , list < string > http , list < string > url , list < string > context ) throws api exception { object local var post body = null ; / / verify the required parameter ' pipe ' is set if ( pipe = = null ) { throw new api exception ( 400 , " missing the required parameter ' pipe ' when calling test query parameter collection format " ) ; } / / verify the required parameter ' ioutil ' is set if ( ioutil = = null ) { throw new api exception ( 400 , " missing the required parameter ' ioutil ' when calling test query parameter collection format " ) ; } / / verify the required parameter ' http ' is set if ( http = = null ) { throw new api exception ( 400 , " missing the required parameter ' http ' when calling test query parameter collection format " ) ; } / / verify the required parameter ' url ' is set if ( url = = null ) { throw new api exception ( 400 , " missing the required parameter ' url ' when calling test query parameter collection format " ) ; } / / verify the required parameter ' context ' is set if ( context = = null ) { throw new api exception ( 400 , " missing the required parameter ' context ' when calling test query parameter collection format " ) ; } / / create path and map variables string local var path = " / fake / test - query - paramters " ; / / query params list < pair > local var query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; local var query params add all ( api client parameter to pairs ( " csv " , " pipe " , pipe ) ) ; local var query params add all ( api client parameter to pairs ( " csv " , " ioutil " , ioutil ) ) ; local var query params add all ( api client parameter to pairs ( " ssv " , " http " , http ) ) ; local var query params add all ( api client parameter to pairs ( " csv " , " url " , url ) ) ; local var query params add all ( api client parameter to pairs ( " multi " , " context " , context ) ) ; final string [ ] local var accepts = { } ; final string local var accept = api client select header accept ( local var accepts ) ; final string [ ] local var content types = { } ; final string local var content type = api client select header content type ( local var content types ) ; string [ ] local var auth names = new string [ ] { } ; return api client invoke a p i ( " fake api test query parameter collection format " , local var path , " put " , local var query params , local var post body , local var header params , local var cookie params , local var form params , local var accept , local var content type , local var auth names , null , false ) ; }


test that { @ link mutable quantiles } rolls the window over at the specified interval

public void test mutable quantiles rollover ( ) throws exception { metrics record builder mb = mock metrics record builder ( ) ; metrics registry registry = new metrics registry ( " test " ) ; / / use a 5s rollover period mutable quantiles quantiles = registry new quantiles ( " foo " , " stat " , " ops " , " latency " , 5 ) ; quantile [ ] quants = mutable quantiles quantiles ; string name = " foo % dth percentile latency " ; string desc = " % d percentile latency with 5 second interval for stat " ; / / push values for three intervals long start = system nano time ( ) / 1000000 ; for ( int i = 1 ; i < = 3 ; i + + ) { / / insert the values for ( long j = 1 ; j < = 1000 ; j + + ) { quantiles add ( i ) ; } / / sleep until 1s after the next 5s interval , to let the metrics / / roll over long sleep = ( start + ( 5000 * i ) + 1000 ) - ( system nano time ( ) / 1000000 ) ; thread sleep ( sleep ) ; / / verify that the window reset , check it has the values we pushed in registry snapshot ( mb , false ) ; for ( quantile q : quants ) { int percentile = ( int ) ( 100 * q quantile ) ; string n = string format ( name , percentile ) ; string d = string format ( desc , percentile ) ; verify ( mb ) add gauge ( info ( n , d ) , ( long ) i ) ; } } / / verify the metrics were added the right number of times verify ( mb , times ( 3 ) ) add gauge ( info ( " foo num ops " , " number of ops for stat with 5s interval " ) , ( long ) 1000 ) ; for ( quantile q : quants ) { int percentile = ( int ) ( 100 * q quantile ) ; string n = string format ( name , percentile ) ; string d = string format ( desc , percentile ) ; verify ( mb , times ( 3 ) ) add gauge ( eq ( info ( n , d ) ) , any long ( ) ) ; } }


public void remove parse listeners ( ) { parse listeners = null ; }


default string get service group ( string key ) { key = prefix service root + config split char + prefix service mapping + key ; if ( ! service group name contains ( key ) ) { configuration cache add config listener ( key ) ; service group name add ( key ) ; } return configuration factory get instance ( ) get config ( key ) ; }


get the config variable prefix for the specified mount table

public static string get config view fs prefix ( final string mount table name ) { return constants config viewfs prefix + " " + mount table name ; }


create a { @ link mock multipart http servlet request builder } for a multipart request

public static mock multipart http servlet request builder multipart ( string url template , object uri vars ) { return new mock multipart http servlet request builder ( url template , uri vars ) ; }


return an introduction advisor mixin that allows the aop proxy to be cast to thread local invoker stats

public introduction advisor get stats mixin ( ) { delegating introduction interceptor dii = new delegating introduction interceptor ( this ) ; return new default introduction advisor ( dii , thread local target source stats class ) ; }


the parameter value from the specified registry { @ link url }

public string get value ( url registry u r l ) { return registry u r l get parameter ( name , default value ) ; }


return the integer value of this status series ranges from 1 to 5

public int value ( ) { return this value ; }


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

public void test app priority x m l ( ) throws exception { string app id = submit application ( ) ; list < app priority > responses = perform get calls ( rm web service path + format ( apps appid priority , app id ) , app priority class , null , null ) ; app priority router response = responses get ( 0 ) ; app priority rm response = responses get ( 1 ) ; assert not null ( router response ) ; assert not null ( rm response ) ; assert equals ( rm response get priority ( ) , router response get priority ( ) ) ; }


returns the output to input variable mapping for the given source channel

public map < variable reference expression , variable reference expression > source variable map ( int source index ) { map < variable reference expression , variable reference expression > result = new linked hash map < > ( ) ; for ( map entry < variable reference expression , list < variable reference expression > > entry : output to inputs entry set ( ) ) { result put ( entry get key ( ) , entry get value ( ) get ( source index ) ) ; } return unmodifiable map ( result ) ; }


return whether the progress of this transaction is debugged this is used by { @ link abstract platform transaction manager } as an optimization , to prevent repeated calls to { @ code logger is debug enabled ( ) } not really intended for client code

public boolean is debug ( ) { return this debug ; }


returns true if the cursor is allow to be position past the last character

public boolean is allow cursor at end ( ) { return allow cursor at end ; }


apply an impulse at a point this immediately modifies the velocity it also modifies the angular velocity if the point of application is not at the center of mass this wakes up the body if ' wake ' is set to true if the body is sleeping and ' wake ' is false , then there is no effect

public final void apply linear impulse ( vec 2 impulse , vec 2 point , boolean wake ) { if ( m type ! = body type dynamic ) { return ; } if ( ! is awake ( ) ) { if ( wake ) { set awake ( true ) ; } else { return ; } } m linear velocity x + = impulse x * m inv mass ; m linear velocity y + = impulse y * m inv mass ; m angular velocity + = m inv i * ( ( point x - m sweep c x ) * impulse y - ( point y - m sweep c y ) * impulse x ) ; }


protected boolean is socket open ( ) { return sock is open ( ) ; }


public int hash code ( ) { return subroutine address ; }


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


get the method argument values for the current request , checking the provided argument values and falling back to the configured argument resolvers the resulting array will be passed into { @ link # do invoke }

protected object [ ] get method argument values ( native web request request , @ nullable model and view container mav container , object provided args ) throws exception { method parameter [ ] parameters = get method parameters ( ) ; if ( object utils is empty ( parameters ) ) { return empty args ; } object [ ] args = new object [ parameters length ] ; for ( int i = 0 ; i < parameters length ; i + + ) { method parameter parameter = parameters [ i ] ; parameter init parameter name discovery ( this parameter name discoverer ) ; args [ i ] = find provided argument ( parameter , provided args ) ; if ( args [ i ] ! = null ) { continue ; } if ( ! this resolvers supports parameter ( parameter ) ) { throw new illegal state exception ( format argument error ( parameter , " no suitable resolver " ) ) ; } try { args [ i ] = this resolvers resolve argument ( parameter , mav container , request , this data binder factory ) ; } catch ( exception ex ) { / / leave stack trace for later , exception may actually be resolved and handled if ( logger is debug enabled ( ) ) { string ex msg = ex get message ( ) ; if ( ex msg ! = null & & ! ex msg contains ( parameter get executable ( ) to generic string ( ) ) ) { logger debug ( format argument error ( parameter , ex msg ) ) ; } } throw ex ; } } return args ; }


find the fields constant that matches name , or null if its not found

public static fields find by name ( string name ) { return by name get ( name ) ; }


read window state from an operator in a { @ code savepoint } this method supports reading from any type of window

public < w extends window > window reader < w > window ( type serializer < w > window serializer ) { preconditions check not null ( window serializer , " the window serializer must not be null " ) ; return new window reader < > ( env , metadata , state backend , window serializer ) ; }


gets the decompressor for a file name this checks the file against all known and supported file extensions returns null if there is no decompressor for this file name

public static inflater input stream factory < ? > get decompressor for file name ( string file name ) { for ( final map entry < string , inflater input stream factory < ? > > entry : decompressors entry set ( ) ) { if ( file name ends with ( entry get key ( ) ) ) { return entry get value ( ) ; } } return null ; }


read a double like data input stream read double except little endian

public final double read double ( ) throws i o exception { return double long bits to double ( read long ( ) ) ; }


discard all editlog segments whose first txid is greater than or equal to the given txid , by renaming them with suffix " trash "

private void discard edit log segments ( long start tx id ) throws i o exception { file current dir = sd get current dir ( ) ; list < edit log file > all log files = match edit logs ( current dir ) ; list < edit log file > to trash = lists new array list ( ) ; log info ( " discard the edit log files , the given start txid is " + start tx id ) ; / / go through the editlog files to make sure the start tx id is right at the / / segment boundary for ( edit log file elf : all log files ) { if ( elf get first tx id ( ) > = start tx id ) { to trash add ( elf ) ; } else { preconditions check state ( elf get last tx id ( ) < start tx id ) ; } } for ( edit log file elf : to trash ) { / / rename these editlog file as trash elf move aside trash file ( start tx id ) ; log info ( " trash the edit log file " + elf ) ; } }


advanced api to allow for multi - dimensional load balancing by remote server for receiving lb assignments , the steps are : 1 , the management server is configured with per clusterzoneload metric capacity configuration the capacity configuration definition is outside of the scope of this document 2 envoy issues a standard { stream , fetch } endpoints request for the clusters to balance independently , envoy will initiate a stream load stats bidi stream with a management server : 1 once a connection establishes , the management server publishes a load stats response for all clusters it is interested in learning load stats about 2 for each cluster , envoy load balances incoming traffic to upstream hosts based on per - zone weights andor per - instance weights ( if specified ) based on intra - zone lb policy this information comes from the above { stream , fetch } endpoints 3 when upstream hosts reply , they optionally add header & lt ; define header name & gt ; with ascii representation of endpoint load metric stats 4 envoy aggregates load reports over the period of time given to it in load stats response load reporting interval this includes aggregation stats envoy maintains by itself ( total requests , rpc errors etc ) as well as load metrics from upstream hosts 5 when the timer of load reporting interval expires , envoy sends new load stats request filled with load reports for each cluster 6 the management server uses the load reports from all reported envoys from around the world , computes global assignment and prepares traffic assignment destined for each zone envoys are located in goto 2

public io grpc stub stream observer < io envoyproxy envoy service load stats v 3 load stats request > stream load stats ( io grpc stub stream observer < io envoyproxy envoy service load stats v 3 load stats response > response observer ) { return io grpc stub client calls async bidi streaming call ( get channel ( ) new call ( get stream load stats method ( ) , get call options ( ) ) , response observer ) ; }


public void set digest ( string hex ) { if ( hex length ( ) ! = md5 len * 2 ) throw new illegal argument exception ( " wrong length : " + hex length ( ) ) ; byte [ ] digest = new byte [ md5 len ] ; for ( int i = 0 ; i < md5 len ; i + + ) { int j = i < < 1 ; digest [ i ] = ( byte ) ( char to nibble ( hex char at ( j ) ) < < 4 | char to nibble ( hex char at ( j + 1 ) ) ) ; } this digest = digest ; }


change the underlying limitations note the change will be taken as best effort , meaning that all already scheduled traffics will not be changed , but only applied to new traffics so the expected usage of this method is to be used not too often , accordingly to the traffic shaping configuration

public void configure ( long new write limit , long new read limit ) { write limit = new write limit ; read limit = new read limit ; if ( traffic counter ! = null ) { traffic counter reset accounting ( traffic counter milli second from nano ( ) ) ; } }


invalidates access to the current schema serializer this lets { @ link # current schema serializer ( ) } fail when invoked access to the current schema serializer should be invalidated by the methods { @ link # register new serializer for restored state ( type serializer ) } or { @ link # set previous serializer snapshot for restored state ( type serializer snapshot ) } once the registered serializer is determined to be incompatible

protected final void invalidate current schema serializer access ( ) { this is registered with incompatible serializer = true ; }


create a new type descriptor for an object use this factory method to introspect a source object before asking the conversion system to convert it to some another type if the provided object is { @ code null } , returns { @ code null } , else calls { @ link # value of ( class ) } to build a type descriptor from the object ' s class

public static type descriptor for object ( @ nullable object source ) { return ( source ! = null ? value of ( source get class ( ) ) : null ) ; }


public listing panel get right panel ( ) { return listing panels [ right ] ; }


returns the workspace - relative path of the specified target ( file or rule ) for example , " foobar : wiz " and " foo : barwiz " both result in " foobarwiz "

public static path fragment get workspace relative path ( label label ) { return label get package fragment ( ) get relative ( label get name ( ) ) ; }


transitions from the alpha at the time this action starts to an alpha of 1

static public alpha action fade in ( float duration ) { return alpha ( 1 , duration , null ) ; }


returns a list of all profiled children queries

public list < profile result > get profiled children ( ) { return collections unmodifiable list ( children ) ; }


override with any special text escaping logic

public string escape text ( string input ) { if ( input = = null ) { return input ; } / * * * trim the input text always * / string result = input trim ( ) ; / * * * remove standalone ' \ ' * * replace " with \ " * outter unescape to retain the original multi - byte characters * / result = escape unsafe characters ( string escape utils unescape java ( string escape utils escape java ( result ) replace ( " \ \ / " , " / " ) ) replace ( " \ \ " , " \ \ \ \ " ) replace ( " \ " " , " \ \ \ " " ) ) ; if ( this process markdown ) { / * * * convert markdown strong * * bold text * * and bold text * to bash bold control sequences ( tput bold ) * / result = result replace all ( " ( ? m ) ( ^ | \ \ s ) \ \ * { 2 } ( [ \ \ w \ \ d ] + ) \ \ * { 2 } ( $ | \ \ s ) " , " \ \ $ \ \ ( tput bold \ \ ) $ 2 \ \ $ \ \ ( tput sgr 0 \ \ ) " ) ; result = result replace all ( " ( ? m ) ( ^ | \ \ s ) { 2 } ( [ \ \ w \ \ d ] + ) { 2 } ( $ | \ \ s ) " , " \ \ $ \ \ ( tput bold \ \ ) $ 2 \ \ $ \ \ ( tput sgr 0 \ \ ) " ) ; / * * * convert markdown * italics text * and italics text to bash dim * control sequences ( tput dim ) * / result = result replace all ( " ( ? m ) ( ^ | \ \ s ) \ \ * { 1 } ( [ \ \ w \ \ d ] + ) \ \ * { 1 } ( $ | \ \ s ) " , " \ \ $ \ \ ( tput dim \ \ ) $ 2 \ \ $ \ \ ( tput sgr 0 \ \ ) " ) ; result = result replace all ( " ( ? m ) ( ^ | \ \ s ) { 1 } ( [ \ \ w \ \ d ] + ) { 1 } ( $ | \ \ s ) " , " \ \ $ \ \ ( tput dim \ \ ) $ 2 \ \ $ \ \ ( tput sgr 0 \ \ ) " ) ; / * * * convert all markdown section 1 level headers with bold * / result = result replace all ( " ( ? m ) ^ \ \ # \ \ s + ( + ) $ " , " \ n \ \ $ \ \ ( tput bold \ \ ) \ \ $ \ \ ( tput setaf 7 \ \ ) " + " $ 1 \ \ $ \ \ ( tput sgr 0 \ \ ) " ) ; / * * * convert all markdown section 2 level headers with bold * / result = result replace all ( " ( ? m ) ^ \ \ # \ \ # \ \ s + ( + ) $ " , " \ n \ \ $ \ \ ( tput bold \ \ ) \ \ $ \ \ ( tput setaf 7 \ \ ) " + " $ 1 \ \ $ \ \ ( tput sgr 0 \ \ ) " ) ; / * * * convert all markdown section 3 level headers with bold * / result = result replace all ( " ( ? m ) ^ \ \ # \ \ # \ \ # \ \ s + ( + ) $ " , " \ n \ \ $ \ \ ( tput bold \ \ ) \ \ $ \ \ ( tput setaf 7 \ \ ) " + " $ 1 \ \ $ \ \ ( tput sgr 0 \ \ ) " ) ; / * * * convert all markdown code blocks into - - - delimited sections * / result = result replace all ( " ( ? m ) \ \ s * ` ` ` * $ " , " \ n - - - " ) ; result = result replace all ( " ( ? m ) \ \ s * \ \ ' \ \ ' \ \ ' * $ " , " \ n - - - " ) ;


allocate a direct buffer of the specified size , in bytes if a pooled buffer is available , returns that otherwise allocates a new one

public byte buffer get buffer ( int size ) { queue < weak reference < byte buffer > > list = buffers by size get ( size ) ; if ( list = = null ) { / / no available buffers for this size return byte buffer allocate direct ( size ) ; } weak reference < byte buffer > ref ; while ( ( ref = list poll ( ) ) ! = null ) { byte buffer b = ref get ( ) ; if ( b ! = null ) { return b ; } } return byte buffer allocate direct ( size ) ; }


get block locations for this entity , in hdfs format see { @ link # make qualified located ( uri , path ) } see { @ link d f s util client # located blocks 2 locations ( located blocks ) }

public located blocks get located blocks ( ) { return hdfsloc ; }


the factory method of this jar transformation record

static jar transformation record create ( immutable list < path > input jars , immutable list < path > output jars , immutable list < path > class path entries , immutable list < path > boot class path entries , immutable list multimap < string , string > extra custom command options ) { return new auto value jar transformation record ( input jars , output jars , class path entries , boot class path entries , extra custom command options ) ; }


writes the data for the specified key - group to the output you must call { @ link # get key group writer ( ) } once before first calling this method

void write state in key group ( @ nonnull data output view dov , @ nonnegative int key group id ) throws i o exception ;


get the extended block id associated with this slot

public extended block id get block id ( ) { return block id ; }


return the servlet path under which the servlet is deployed by checking the servlet registration from { @ link # init ( servlet config ) }

public string get servlet path ( ) { return this servlet path ; }


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


copies this string removing white space characters from the beginning and end of the string , and tries not to copy if possible

public static char sequence trim ( char sequence c ) { if ( c instanceof ascii string ) { return ( ( ascii string ) c ) trim ( ) ; } if ( c instanceof string ) { return ( ( string ) c ) trim ( ) ; } int start = 0 , last = c length ( ) - 1 ; int end = last ; while ( start < = end & & c char at ( start ) < = ' ' ) { start + + ; } while ( end > = start & & c char at ( end ) < = ' ' ) { end - - ; } if ( start = = 0 & & end = = last ) { return c ; } return c sub sequence ( start , end ) ; }


stores the next result set row in a tuple

public row data next record ( row data reuse ) throws i o exception { try { if ( ! has next ) { return null ; } row data row = row converter to internal ( result set ) ; / / update has next after we ' ve read the record has next = result set next ( ) ; return row ; } catch ( s q l exception se ) { throw new i o exception ( " couldn ' t read data - " + se get message ( ) , se ) ; } catch ( null pointer exception npe ) { throw new i o exception ( " couldn ' t access result set " , npe ) ; } }


attempt to satisfy this read in an optimized fashion using { @ code stream for sequential reads ref }

private int read optimized ( int part , long pos , byte buffer b , int length ) throws i o exception { if ( sequential read size = = no sequential read optimization ) { return 0 ; } int read = 0 ; if ( stream for sequential reads = = null ) { / / starting a new sequential read read = read from new sequential stream ( part , pos , b , length ) ; } else if ( stream for sequential reads can continue sequential read ( part , pos ) ) { / / continuing a sequential read that we started previously read = stream for sequential reads read ( b , length ) ; if ( stream for sequential reads is fully read ( ) ) { / / the current stream was exhausted by this read , so it should be closed stream for sequential reads close ( ) ; stream for sequential reads = null ; } else { / / the current stream contained enough data for this read and more besides , so we leave it in place assert read = = length : length + " remaining " ; } if ( read < length ) { / / the current stream didn ' t contain enough data for this read , so we must read more read + = read from new sequential stream ( part , pos + read , b , length - read ) ; } } else { / / not a sequential read , so stop optimizing for this usage pattern and fall through to the unoptimized behaviour assert stream for sequential reads is fully read ( ) = = false ; sequential read size = no sequential read optimization ; close stream for sequential reads ( ) ; } return read ; }


return the value to which this cache maps the specified key , obtaining that value from { @ code value loader } if necessary this method provides a simple substitute for the conventional " if cached , return ; otherwise create , cache and return " pattern if possible , implementations should ensure that the loading operation is synchronized so that the specified { @ code value loader } is only called once in case of concurrent access on the same key if the { @ code value loader } throws an exception , it is wrapped in a { @ link value retrieval exception }

< t > t get ( object key , callable < t > value loader ) ;


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

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


returns the index of the first character in the string that is not a digit , starting at offset

private static int index of non digit ( string string , int offset ) { for ( int i = offset ; i < string length ( ) ; i + + ) { char c = string char at ( i ) ; if ( c < ' 0 ' | | c > ' 9 ' ) return i ; } return string length ( ) ; }


returns the next value as a stream of utf - 8 bytes and consumes it the following program demonstrates how json bytes are returned from an enclosing stream as their original bytes , including their original whitespace : { @ code string json = " { \ " a \ " : [ 4 , 5 , 6 0 , { \ " x \ " : 7 } , 8 ] , \ " b \ " : 9 } " ; json reader reader = json reader of ( new buffer ( ) write utf 8 ( json ) ) ; reader begin object ( ) ; assert that ( reader next name ( ) ) is equal to ( " a " ) ; try ( buffered source buffered source = reader value source ( ) ) { assert that ( buffered source read utf 8 ( ) ) is equal to ( " [ 4 , 5 , 6 0 , { \ " x \ " : 7 } , 8 ] " ) ; } assert that ( reader next name ( ) ) is equal to ( " b " ) ; assert that ( reader next int ( ) ) is equal to ( 9 ) ; reader end object ( ) ; } this reads an entire value : composite objects like arrays and objects are returned in their entirety the stream starts with the first character of the value ( typically { @ code [ } , < code > { < code > , or { @ code " } ) and ends with the last character of the object ( typically { @ code ] } , < code > } < code > , or { @ code " } ) the returned source may not be used after any other method on this { @ code json reader } is called for example , the following code crashes with an exception : { @ code json reader reader = reader begin array ( ) ; buffered source source = reader value source ( ) ; reader end array ( ) ; source read utf 8 ( ) ; crash ! } the returned bytes are not validated this method assumes the stream is well - formed json and only attempts to find the value ' s boundary in the byte stream it is the caller ' s responsibility to check that the returned byte stream is a valid json value closing the returned source does not close this reader

public abstract buffered source next source ( ) throws i o exception ;


public void find global session test ( global session global session ) throws exception { for ( session manager session manager : session manager list ) { session manager add global session ( global session ) ; global session expected = session manager find global session ( global session get xid ( ) ) ; assertions assert not null ( expected ) ; assertions assert equals ( expected get transaction id ( ) , global session get transaction id ( ) ) ; assertions assert equals ( expected get application id ( ) , global session get application id ( ) ) ; assertions assert equals ( expected get transaction service group ( ) , global session get transaction service group ( ) ) ; assertions assert equals ( expected get transaction name ( ) , global session get transaction name ( ) ) ; assertions assert equals ( expected get transaction id ( ) , global session get transaction id ( ) ) ; assertions assert equals ( expected get status ( ) , global session get status ( ) ) ; session manager remove global session ( global session ) ; } }


given a set of votes , return the synced learner tracker which is used to determines if have sufficient to declare the end of the election round

protected synced learner tracker get vote tracker ( map < long , vote > votes , vote vote ) { synced learner tracker vote set = new synced learner tracker ( ) ; vote set add quorum verifier ( self get quorum verifier ( ) ) ; if ( self get last seen quorum verifier ( ) ! = null & & self get last seen quorum verifier ( ) get version ( ) > self get quorum verifier ( ) get version ( ) ) { vote set add quorum verifier ( self get last seen quorum verifier ( ) ) ; } / * * first make the views consistent sometimes peers will have different * zxids for a server depending on timing * / for ( map entry < long , vote > entry : votes entry set ( ) ) { if ( vote equals ( entry get value ( ) ) ) { vote set add ack ( entry get key ( ) ) ; } } return vote set ; }


get the { @ linkplain merged annotation selectors # nearest ( ) nearest } matching annotation or meta - annotation of the specified type , or { @ link merged annotation # missing ( ) } if none is present

< a extends annotation > merged annotation < a > get ( string annotation type , @ nullable predicate < ? super merged annotation < a > > predicate ) ;


public void after last ( ) throws s q l exception { }


return the skewness - not public , used for get property ( )

protected map < string , double > get skewness ( ) { return collections unmodifiable map ( results skewness ) ; }


public static boolean write file from bytes by stream ( final file file , final byte [ ] bytes , final boolean append ) { return write file from bytes by stream ( file , bytes , append , null ) ; } / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / write file from bytes by stream with progress / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /


public static void main ( string [ ] args ) { pentomino model = new one sided pentomino ( 3 , 30 ) ; int solutions = model solve ( ) ; system out println ( solutions + " solutions found " ) ; }


if this flag is set then yoga would diff the layout without legacy flag and would set a bool in yoga node ( m does legacy stretch flag affects layout ) with true if the layouts were different and false if not

public void set should diff layout without legacy stretch behaviour ( boolean should diff layout without legacy stretch behaviour ) { yoga native jni y g config set should diff layout without legacy stretch behaviour j n i ( m native pointer , should diff layout without legacy stretch behaviour ) ; }


adds a range to a object assumes that the range has already been cleared < p >

private void add range ( object obj , long start , long end ) { try { long next ; if ( obj markers has property ( start ) ) { next = start ; } else { next = obj markers get next property index ( start ) ; } while ( start < = end ) { / / find the thing at or after mark mark = get mark ( next ) ; if ( mark type = = mark end ) { mark end ( start - 1 , mark obj ) ; mark start ( start , mark obj ) ; next = start ; } else if ( start = = next ) { if ( mark type = = mark single ) { mark add ( obj ) ; start = start + 1 ; } else { / / type = = mark start next = obj markers get next property index ( next ) ; start = do split ( obj , start , next , end ) + 1 ; } next = obj markers get next property index ( next ) ; } else if ( start < next & & next < = end ) { / / add in start to next - 1 mark range ( start , next - 1 , obj ) ; start = next ; } else if ( next > end ) { break ; } } } catch ( no such index exception e ) { } if ( start < = end ) { mark range ( start , end , obj ) ; } }


sets the heuristic network cost for this costs object

public void set heuristic network cost ( double cost ) { if ( cost < = 0 ) { throw new illegal argument exception ( " heuristic costs must be positive " ) ; } this heuristic network cost = cost ; }


processes resources for generated sources , configs and packaging resources returns a post - processed merged android data notably , the resources will be stripped of any databinding expressions

public merged android data process resources ( path temp root , path aapt , path android jar , @ nullable revision build tools version , variant type variant type , boolean debug , string custom package for r , aapt options aapt options , collection < string > resource configs , boolean use data binding android x , merged android data primary data , list < dependency android data > dependency data , @ nullable path source out , @ nullable path package out , @ nullable path proguard out , @ nullable path main dex proguard out , @ nullable path public resources out , @ nullable path data binding info out ) throws i o exception , interrupted exception , logged error exception { path android manifest = primary data get manifest ( ) ; final path resource dir = process data bindings ( primary data get resource dir ( ) resolve sibling ( " res no binding " ) , primary data get resource dir ( ) , data binding info out , custom package for r , / * should zip data binding info = * / true , use data binding android x ) ; final path assets dir = primary data get asset dir ( ) ; if ( public resources out ! = null ) { prepare output path ( public resources out get parent ( ) ) ; } run aapt ( temp root , aapt , android jar , build tools version , variant type , debug , custom package for r , aapt options , resource configs , android manifest , resource dir , assets dir , source out , package out , proguard out , main dex proguard out , public resources out ) ; / / the r needs to be created for each library in the dependencies , / / but only if the current project is not a library if ( source out ! = null & & variant type ! = variant type library ) { write dependency package r java files ( dependency data , custom package for r , android manifest , source out ) ; } return new merged android data ( resource dir , assets dir , android manifest ) ; }


draws an area form another pixmap to this pixmap

public void draw pixmap ( pixmap pixmap , int x , int y , int srcx , int srcy , int src width , int src height ) { canvas element image = pixmap get canvas element ( ) ; image ( image , srcx , srcy , src width , src height , x , y , src width , src height ) ; }


returns the length of the underlying file

public long length ( ) throws i o exception { return provider length ( ) ; }


takes the first color , blending into it the second color , using the given ratio a lower ratio ( say 1f ) signals to use very little of the first color ; a larger ratio signals to use more of the first color

public static color blend ( color c 1 , color c 2 , float ratio ) { float rgb 1 [ ] = new float [ 3 ] ; float rgb 2 [ ] = new float [ 3 ] ; c 1 get color components ( rgb 1 ) ; c 2 get color components ( rgb 2 ) ; float inverse = ( float ) 1 0 - ratio ; / / @ formatter : off color color = new color ( rgb 1 [ 0 ] * ratio + rgb 2 [ 0 ] * inverse , rgb 1 [ 1 ] * ratio + rgb 2 [ 1 ] * inverse , rgb 1 [ 2 ] * ratio + rgb 2 [ 2 ] * inverse ) ; / / @ formatter : on return color ; }


return a structured object with internal state and counters

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


propagates { @ code throwable } exactly as - is , if and only if it is an instance of { @ link runtime exception } , { @ link error } , or { @ code declared type } example usage : try { some method that could throw anything ( ) ; } catch ( i know what to do with this exception e ) { handle ( e ) ; } catch ( throwable t ) { throwables propagate if possible ( t , other exception class ) ; throw new runtime exception ( " unexpected " , t ) ; }

public static < x extends throwable > void propagate if possible ( @ nullable throwable throwable , class < x > declared type ) throws x { propagate if instance of ( throwable , declared type ) ; propagate if possible ( throwable ) ; }


receive a message , which can come from the queued buffer or from a new buffer coming in over the channel this should only be called from the event loop thread note that this method does not call < code > message release ( ) < code > the caller is responsible for making sure the message is released after this method returns

private void receive message ( byte buf message ) { check is in event loop ( " receive message " ) ; try { while ( message is readable ( ) & & ! throttled get ( ) ) { if ( bb ! = null ) { if ( log is trace enabled ( ) ) { log trace ( " message readable { } bb len { } { } " , message readable bytes ( ) , bb remaining ( ) , bb ) ; byte buffer dat = bb duplicate ( ) ; dat flip ( ) ; log trace ( " 0x { } bb { } " , long to hex string ( session id ) , byte buf util hex dump ( unpooled wrapped buffer ( dat ) ) ) ; } if ( bb remaining ( ) > message readable bytes ( ) ) { int new limit = bb position ( ) + message readable bytes ( ) ; bb limit ( new limit ) ; } message read bytes ( bb ) ; bb limit ( bb capacity ( ) ) ; if ( log is trace enabled ( ) ) { log trace ( " after read bytes message readable { } bb len { } { } " , message readable bytes ( ) , bb remaining ( ) , bb ) ; byte buffer dat = bb duplicate ( ) ; dat flip ( ) ; log trace ( " after readbytes 0x { } bb { } " , long to hex string ( session id ) , byte buf util hex dump ( unpooled wrapped buffer ( dat ) ) ) ; } if ( bb remaining ( ) = = 0 ) { bb flip ( ) ; packet received ( 4 + bb remaining ( ) ) ; zoo keeper server zks = this zk server ; if ( zks = = null | | ! zks is running ( ) ) { throw new i o exception ( " zk down " ) ; } if ( initialized ) { / / todo : if zks process packet ( ) is changed to take a byte buffer [ ] , / / we could implement zero - copy queueing zks process packet ( this , bb ) ; } else { log debug ( " got conn req request from { } " , get remote socket address ( ) ) ; zks process connect request ( this , bb ) ; initialized = true ; } bb = null ; } } else { if ( log is trace enabled ( ) ) { log trace ( " message readable { } bblenrem { } " , message readable bytes ( ) , bb len remaining ( ) ) ; byte buffer dat = bb len duplicate ( ) ; dat flip ( ) ; log trace ( " 0x { } bb len { } " , long to hex string ( session id ) , byte buf util hex dump ( unpooled wrapped buffer ( dat ) ) ) ; } if ( message readable bytes ( ) < bb len remaining ( ) ) { bb len limit ( bb len position ( ) + message readable bytes ( ) ) ; } message read bytes ( bb len ) ; bb len limit ( bb len capacity ( ) ) ; if ( bb len remaining ( ) = = 0 ) { bb len flip ( ) ; if ( log is trace enabled ( ) ) { log trace ( " 0x { } bb len { } " , long to hex string ( session id ) , byte buf util hex dump ( unpooled wrapped buffer ( bb len ) ) ) ; } int len = bb len get int ( ) ; if ( log is trace enabled ( ) ) { log trace ( " 0x { } bb len len is { } " , long to hex string ( session id ) , len ) ; } bb len clear ( ) ; if ( ! initialized ) { if ( check four letter word ( channel , message , len ) ) { return ; } } if ( len < 0 | | len > binary input archive max buffer ) { throw new i o exception ( " len error " + len ) ; } / / check request size will throw i o exception if request is rejected zk server check request size when receiving message ( len ) ; bb = byte buffer allocate ( len ) ; } } } } catch ( i o exception e ) { log warn ( " closing connection to { } " , get remote socket address ( ) , e ) ; close ( disconnect reason io exception ) ; } catch ( client cnxn limit exception e ) { / / common case exception , print at debug level server metrics get metrics ( ) connection rejected add ( 1 ) ; log debug ( " closing connection to { } " , get remote socket address ( ) , e ) ; close ( disconnect reason client rate limit ) ; } }


public string get last path component ( ) { return group names [ group names length - 1 ] ; }


return the cumulative size of all files in this directory

long estimate size in bytes ( ) throws i o exception { try { return size get or refresh ( ) size ; } catch ( unchecked i o exception e ) { / / we wrapped in the cache and unwrap here throw e get cause ( ) ; } }


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 }


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

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


check whether the given watcher exists in datatree

public boolean contains watcher ( string path , watcher type type , watcher watcher ) { return data tree contains watcher ( path , type , watcher ) ; }


public final void aux target arg ( int target ) { aux target = target ; }


returns the presentation time of the current sample in microseconds

public long get current sample presentation time us ( ) { return ! currently in fragment ? moov sample table timestamps us [ current sample index ] : fragment get sample presentation time us ( current sample index ) ; }


test serialization of outer string types

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


decodes a base 6 4 encoded string into a newly - allocated byte array using the { @ link base 6 4 } encoding scheme an invocation of this method has exactly the same effect as invoking { @ code decode ( src get bytes ( standard charsets iso 8859 1 ) ) }

public byte [ ] decode ( string src ) { return decode ( src get bytes ( standard charsets iso 8859 1 ) ) ; }


public void user status test ( ) { / / todo : test user status }


public void test chain map no ouptut ( ) throws exception { configuration conf = create job conf ( ) ; string expected output = " " ; job job = map reduce test util create job ( conf , in dir , out dir , 1 , 0 , input ) ; job set job name ( " chain " ) ; chain mapper add mapper ( job , consume map class , int writable class , text class , long writable class , text class , null ) ; chain mapper add mapper ( job , mapper class , long writable class , text class , long writable class , text class , null ) ; job wait for completion ( true ) ; assert true ( " job failed " , job is successful ( ) ) ; assert equals ( " outputs doesn ' t match " , expected output , map reduce test util read output ( out dir , conf ) ) ; }


serves static resources placed along with jelly view files this method can serve a lot of files , so care needs to be taken to make this method secure it ' s not clear to me what ' s the best strategy here , though the current implementation is based on file extensions

public void do resources ( stapler request req , stapler response rsp ) throws i o exception , servlet exception { string path = req get rest of path ( ) ; / / cut off the " " portion of / resources / / path / to / file / / as this is only used to make path unique ( which in turn / / allows us to set a long expiration date path = path substring ( path index of ( ' / ' , 1 ) + 1 ) ; int idx = path last index of ( ' ' ) ; string extension = path substring ( idx + 1 ) ; if ( allowed resource extensions contains ( extension ) ) { url url = plugin manager uber class loader get resource ( path ) ; if ( url ! = null ) { long expires = meta class no cache ? 0 : time unit days to millis ( 365 ) ; rsp serve file ( req , url , expires ) ; return ; } } rsp send error ( http servlet response sc not found ) ; }


public long get succeeded average elapsed ( ) { long succeeded = get succeeded ( ) ; if ( succeeded = = 0 ) { return 0 ; } return get succeeded elapsed ( ) / succeeded ; }


validate all old language definitions contained within the old language map this is intended to be used by a unit test

int validate all old languages ( ) { int error cnt = 0 ; for ( old language old lang : language map values ( ) ) { try { old lang validate ( ) ; } catch ( exception e ) { msg error ( log , " failed to validate old language : " + old lang get description ( ) + " ( version " + old lang get version ( ) + " ) " , e ) ; + + error cnt ; } } return error cnt ; }


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

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


test concenrate watch case where the watcher watches all paths the output of this test will be the average time used to add the watch to all paths

public void test add concentrate watch ( iteration state state ) throws exception { watcher watcher = new dumb watcher ( ) ; / / watch all paths for ( string path : state paths ) { if ( state watch manager add watch ( path , watcher ) ) { state watches added + + ; } } }


centers an image inside of the bounds specified by { @ link # resize ( int , int ) } this scales the image so that both dimensions are equal to or less than the requested bounds

public request creator center inside ( ) { data center inside ( ) ; return this ; }


sets the path of the orc file ( s ) if the path specifies a directory , it will be recursively enumerated

public builder path ( string path ) { preconditions check not null ( path , " path must not be null " ) ; preconditions check argument ( ! path is empty ( ) , " path must not be empty " ) ; this path = path ; return this ; }


public void limit to ( int to ) { if ( to < 0 ) to = 0 ; m to = to ; }


announce creates a log print preventing travis ci from killing the build


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

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


case in - sensitive find of the first index within a char sequence from the specified position this method optimized and works correctly for ascii char sequences only a { @ code null } char sequence will return { @ code - 1 } a negative start position is treated as zero an empty ( " " ) search char sequence always matches a start position greater than the string length only matches an empty search char sequence ascii string index of ignore case ( null , , ) = - 1 ascii string index of ignore case ( , null , ) = - 1 ascii string index of ignore case ( " " , " " , 0 ) = 0 ascii string index of ignore case ( " aabaabaa " , " a " , 0 ) = 0 ascii string index of ignore case ( " aabaabaa " , " b " , 0 ) = 2 ascii string index of ignore case ( " aabaabaa " , " ab " , 0 ) = 1 ascii string index of ignore case ( " aabaabaa " , " b " , 3 ) = 5 ascii string index of ignore case ( " aabaabaa " , " b " , 9 ) = - 1 ascii string index of ignore case ( " aabaabaa " , " b " , - 1 ) = 2 ascii string index of ignore case ( " aabaabaa " , " " , 2 ) = 2 ascii string index of ignore case ( " abc " , " " , 9 ) = - 1

public static int index of ignore case ascii ( final char sequence str , final char sequence search str , int start pos ) { if ( str = = null | | search str = = null ) { return index not found ; } if ( start pos < 0 ) { start pos = 0 ; } int search str len = search str length ( ) ; final int end limit = str length ( ) - search str len + 1 ; if ( start pos > end limit ) { return index not found ; } if ( search str len = = 0 ) { return start pos ; } for ( int i = start pos ; i < end limit ; i + + ) { if ( region matches ascii ( str , true , i , search str , 0 , search str len ) ) { return i ; } } return index not found ; }


public vertex to ( ) { return this to ; }


offer a limited view ( including offset ) for the given list

public < e > list < e > view ( list < e > values ) { if ( values = = null | | values is empty ( ) ) { return values ; } if ( limit = = 0 ) { return empty list ( ) ; } if ( limit < 0 ) { values = new array list < > ( values ) ; collections reverse ( values ) ; } int size = values size ( ) ; if ( size > = total ) { return values sub list ( offset , total ) ; } int l = abs limit ( ) ; if ( size < = l ) { return values ; } return values sub list ( size - l , values size ( ) ) ; }


called when the mount item this delegate is referred to is moved to another position to also update the indexes of the touch expansion delegate

void move touch expansion indexes ( int old index , int new index ) { if ( m delegates get ( new index ) ! = null ) { ensure scrap delegates ( ) ; component host utils scrap item at ( new index , m delegates , m scrap delegates ) ; } component host utils move item ( old index , new index , m delegates , m scrap delegates ) ; release scrap delegates if needed ( ) ; }


return ` true ` if { @ link # done ( long , long , runtime exception ) } has been invoked at least once , ` false ` otherwise

public boolean is done ( ) { return final state ( ) ! = null ; }


void restore config state ( font metrics font metrics , color new edit color ) { set font metrics ( font metrics ) ; set edit color ( new edit color ) ; }


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


get the encryption secrets this potentially sensitive information and must be treated with care

public encryption secrets get encryption secrets ( ) { return encryption secrets ; }


set the content negotiation manager to use for the produces request condition by default this is not set

public void set content type resolver ( requested content type resolver resolver ) { this content type resolver = resolver ; }


public void end ( ) { for ( influencer influencer : influencers ) influencer end ( ) ; emitter end ( ) ; }


display info of each replica for replication block for striped block group , display info of each internal block

private string get replica info ( block info stored block ) { if ( ! ( show locations | | show racks | | show replica details | | show upgrade domains ) ) { return " " ; } final boolean is complete = stored block is complete ( ) ; iterator < datanode storage info > storages itr ; string builder sb = new string builder ( " [ " ) ; final boolean is striped = stored block is striped ( ) ; map < datanode storage info , long > storage 2 id = new hash map < > ( ) ; if ( is complete ) { if ( is striped ) { long block id = stored block get block id ( ) ; iterable < storage and block index > sis = ( ( block info striped ) stored block ) get storage and index infos ( ) ; for ( storage and block index si : sis ) { storage 2 id put ( si get storage ( ) , block id + si get block index ( ) ) ; } } storages itr = stored block get storage infos ( ) ; } else { storages itr = stored block get under construction feature ( ) get expected storage locations iterator ( ) ; } while ( storages itr has next ( ) ) { datanode storage info storage = storages itr next ( ) ; if ( is striped & & is complete ) { long index = storage 2 id get ( storage ) ; sb append ( " blk " + index + " : " ) ; } datanode descriptor dn desc = storage get datanode descriptor ( ) ; if ( show racks ) { sb append ( node base get path ( dn desc ) ) ; } else { sb append ( new datanode info with storage ( dn desc , storage get storage i d ( ) , storage get storage type ( ) ) ) ; } if ( show upgrade domains ) { string upgrade domain = ( dn desc get upgrade domain ( ) ! = null ) ? dn desc get upgrade domain ( ) : undefined ; sb append ( " ( ud = " + upgrade domain + " ) " ) ; } if ( show replica details ) { collection < datanode descriptor > corrupt replicas = block manager get corrupt replicas ( stored block ) ; sb append ( " ( " ) ; if ( dn desc is decommissioned ( ) ) { sb append ( " decommissioned ) " ) ; } else if ( dn desc is decommission in progress ( ) ) { sb append ( " decommissioning ) " ) ; } else if ( this show maintenance state & & dn desc is entering maintenance ( ) ) { sb append ( " entering maintenance ) " ) ; } else if ( this show maintenance state & & dn desc is in maintenance ( ) ) { sb append ( " in maintenance ) " ) ; } else if ( corrupt replicas ! = null & & corrupt replicas contains ( dn desc ) ) { sb append ( " corrupt ) " ) ; } else if ( block manager is excess ( dn desc , stored block ) ) { sb append ( " excess ) " ) ; } else if ( dn desc is stale ( this stale interval ) ) { sb append ( " stale node ) " ) ; } else if ( storage are block contents stale ( ) ) { sb append ( " stale block content ) " ) ; } else { sb append ( " live ) " ) ; } } if ( storages itr has next ( ) ) { sb append ( " , " ) ; } } sb append ( ' ] ' ) ; return sb to string ( ) ; }


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

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


public option < protos slave i d > slave i d ( ) { return slave i d ; }


returns the vertices of the graph in pre - order pre - order is the order the vertices are encountered when performing a depth - first traversal

public static < v , e extends g edge < v > > list < v > get vertices in pre order ( g directed graph < v , e > g , graph navigator < v , e > navigator ) { list < v > pre order = depth first sorter pre order ( g , navigator ) ; return pre order ; }


creates list of users with given input array

public void create users with array input ( list < user > body ) ;


determine if the service has completely stopped used only by unit tests

public boolean is terminated ( ) { return get service state ( ) = = state stopped & & sched is terminated ( ) ; }


release a jndi context as obtained from { @ link # get context ( ) }

public void release context ( @ nullable context ctx ) { if ( ctx ! = null ) { try { ctx close ( ) ; } catch ( naming exception ex ) { logger debug ( " could not close jndi initial context " , ex ) ; } } }


set the ( new ) value of the { @ code access - control - request - headers } request header

public void set access control request headers ( list < string > request headers ) { set ( access control request headers , to comma delimited string ( request headers ) ) ; }


returns the value associated with the given config option as a boolean if no value is mapped under any key of the option , it returns the specified default instead of the option ' s default value

public boolean get boolean ( config option < boolean > config option , boolean override default ) { return get optional ( config option ) or else ( override default ) ; }


creates a key from the given repository name

public static key key ( repository name repository ) { return key create ( repository ) ; }


reboot the device requires root permission or hold { @ code android : shared user id = " android uid system " } , { @ code < uses - permission android : name = " android permission reboot " > }

public static boolean reboot ( final string reason ) { try { power manager pm = ( power manager ) utils get app ( ) get system service ( context power service ) ; pm reboot ( reason ) ; return true ; } catch ( exception e ) { return false ; } }


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

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


returns a pseudorandom , uniformly distributed value between 0 ( inclusive ) and the specified value ( exclusive )

public long next long ( long n ) { if ( n < = 0 ) { throw new illegal argument exception ( " n must be positive " ) ; } / / divide n by two until small enough for next int on each / / iteration ( at most 31 of them but usually much less ) , / / randomly choose both whether to include high bit in result / / ( offset ) and whether to continue with the lower vs upper / / half ( which makes a difference only if odd ) long offset = 0 ; while ( n > = integer max value ) { int bits = next ( 2 ) ; long half = n > > > 1 ; long nextn = ( ( bits & 2 ) = = 0 ) ? half : n - half ; if ( ( bits & 1 ) = = 0 ) { offset + = n - nextn ; } n = nextn ; } return offset + next int ( ( int ) n ) ; }


asynchronously retrieve all headers of the resource specified by the uri template uri template variables are expanded using the given map

listenable future < http headers > head for headers ( string url , map < string , ? > uri variables ) throws rest client exception ;


returns a type that represents an unknown supertype of { @ code bound } for example , if { @ code bound } is { @ code string class } , this returns { @ code ? super string }

public static wildcard type name supertype of ( type name lower bound ) { return new wildcard type name ( collections singleton list ( object ) , collections singleton list ( lower bound ) ) ; }


public object get bean ( ) { return this bean ; }


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


collects the importable aidl files and aidl classsource jars from this rule and its deps

private static android idl provider create android idl provider ( rule context rule context , @ nullable artifact idl class jar , @ nullable artifact idl source jar ) { nested set builder < string > roots builder = nested set builder naive link order ( ) ; nested set builder < artifact > imports builder = nested set builder naive link order ( ) ; nested set builder < artifact > jars builder = nested set builder stable order ( ) ; nested set builder < artifact > preprocessed builder = nested set builder naive link order ( ) ; if ( idl class jar ! = null ) { jars builder add ( idl class jar ) ; } if ( idl source jar ! = null ) { jars builder add ( idl source jar ) ; } for ( android idl provider dep : android common get transitive prerequisites ( rule context , android idl provider provider ) ) { roots builder add transitive ( dep get transitive idl import roots ( ) ) ; imports builder add transitive ( dep get transitive idl imports ( ) ) ; preprocessed builder add transitive ( dep get transitive idl preprocessed ( ) ) ; jars builder add transitive ( dep get transitive idl jars ( ) ) ; } collection < artifact > idl imports = get idl imports ( rule context ) ; if ( ! has explicitly specified idl import root ( rule context ) ) { for ( artifact idl import : idl imports ) { path fragment java root = java util get java root ( idl import get exec path ( ) ) ; if ( java root = = null ) { rule context rule error ( " cannot determine java / javatests root for import " + idl import get exec path string ( ) ) ; } else { roots builder add ( java root to string ( ) ) ; } } } else { path fragment pkg fragment = rule context get label ( ) get package fragment ( ) ; set < path fragment > idl import roots = new hash set < > ( ) ; for ( artifact idl import : idl imports ) { idl import roots add ( idl import get root ( ) get exec path ( ) get relative ( pkg fragment ) get relative ( get idl import root ( rule context ) ) ) ; } for ( path fragment idl import root : idl import roots ) { roots builder add ( idl import root to string ( ) ) ; } } imports builder add all ( idl imports ) ; collection < artifact > idl preprocessed = get idl preprocessed ( rule context ) ; preprocessed builder add all ( idl preprocessed ) ; return new android idl provider ( roots builder build ( ) , imports builder build ( ) , jars builder build ( ) , preprocessed builder build ( ) ) ; }


gets the string representation at the given index in the block

public string get data representation ( byte block block , big integer index ) throws byte block access exception { byte b = block get byte ( index ) ; int i = b ; i & = 0xff ; / / 0377 string str = integer to octal string ( i ) ; if ( str length ( ) > symbol size ) { str = str substring ( str length ( ) - symbol size ) ; } return pad ( str ) ; }


test sending to a destination using the method send ( string d , message creator message creator )

void test send destination name ( ) throws exception { do test send destination ( false , false , true , false ) ; }


public int get code ( ) { return code ; }


gets the end index of the captured group within { @ link markup text # get text ( ) }

public int end ( int group index ) { if ( group index = = 0 ) return end ; return groups [ group index * 2 - 1 ] ; }


action key context get action key context ( ) ;


update query and header parameters based on authentication settings

protected void update params for auth ( string [ ] auth names , auth info auth info , list < pair > query params , multi map header params , multi map cookie params ) { for ( string auth name : auth names ) { authentication auth ; if ( auth info ! = null & & auth info authentications contains key ( auth name ) ) { auth = auth info authentications get ( auth name ) ; } else { auth = authentications get ( auth name ) ; } if ( auth = = null ) throw new runtime exception ( " authentication undefined : " + auth name ) ; auth apply to params ( query params , header params , cookie params ) ; } }


create an action listener that will collect results and finish the request once all results are in

private action listener < exporter resource status > result collector ( final exporter config exporter config , final action listener < monitoring migrate alerts response > listener , final atomic integer remaining , final list < exporter resource status > results ) { return new action listener < > ( ) { @ override public void on response ( exporter resource status exporter resource status ) { add status ( exporter resource status ) ; } @ override public void on failure ( exception e ) { / / need the exporter name and type here for reporting purposes maybe we need to make multiple of these listeners add status ( exporter resource status not ready ( exporter config name ( ) , exporter config type ( ) , e ) ) ; } private void add status ( exporter resource status exporter resource status ) { results add ( exporter resource status ) ; int tasks remaining = remaining decrement and get ( ) ; if ( tasks remaining = = 0 ) { final result ( ) ; } } private void final result ( ) { try { list < exporter migration result > collected results = results stream ( ) map ( status - > new exporter migration result ( status get exporter name ( ) , status get exporter type ( ) , status is complete ( ) , compile reason ( status ) ) ) collect ( collectors to list ( ) ) ; monitoring migrate alerts response response = new monitoring migrate alerts response ( collected results ) ; listener on response ( response ) ; } catch ( exception e ) { / / make this self contained , we don ' t want to bubble up exceptions in a way where this listener ' s / / on failure method could be called multiple times listener on failure ( e ) ; } } private exception compile reason ( exporter resource status status ) { / / the reason for unsuccessful setup could be multiple exceptions : one or more watches / / may fail to be removed for any reason list < exception > exceptions = status get exceptions ( ) ; if ( exceptions = = null | | exceptions size ( ) = = 0 ) { return null ; } else if ( exceptions size ( ) = = 1 ) { return exceptions get ( 0 ) ; } else { / / set first exception as the cause , and the rest as suppressed under it exception head = new elasticsearch exception ( " multiple errors occurred during migration " , exceptions get ( 0 ) ) ; list < exception > tail = exceptions sub list ( 1 , exceptions size ( ) ) ; return tail stream ( ) reduce ( head , exceptions helper : : use or suppress ) ; } } } ; }


gets the { @ link logs } interface used to fetch different types of logs to set the logging preferences { @ link logging preferences }


execute the given { @ link database populator } against the given { @ link connection factory }

default mono < void > populate ( connection factory connection factory ) throws data access exception { assert not null ( connection factory , " connection factory must not be null " ) ; return mono using when ( connection factory utils get connection ( connection factory ) , / / this : : populate , / / connection - > connection factory utils release connection ( connection , connection factory ) , / / ( connection , err ) - > connection factory utils release connection ( connection , connection factory ) , connection - > connection factory utils release connection ( connection , connection factory ) ) on error map ( ex - > ! ( ex instanceof script exception ) , ex - > new uncategorized script exception ( " failed to execute database script " , ex ) ) ; }


implementations of { @ link # compute next } < b > must < b > invoke this method when there are no elements left in the iteration

protected final t end of data ( ) { state = state done ; return null ; }


verifies that the plan compiles in the presence of empty size = 0 estimates

public void test query with size zero inputs ( ) throws exception { test query generic ( 0 , 0 , 0 1f , 0 5f , true , true , true , false , true ) ; }


verify that stateful image results , both intermediate and final , are never cached

public void test do not cache stateful image ( ) { when ( m closeable image 1 is stateful ( ) ) then return ( true ) ; when ( m closeable image 2 is stateful ( ) ) then return ( true ) ; setup bitmap memory cache get not found ( ) ; setup input producer streaming success ( ) ; when ( m memory cache get ( m bitmap memory cache key ) ) then return ( null ) ; m bitmap memory cache producer produce results ( m consumer , m producer context ) ; verify ( m consumer ) on new result ( m intermediate image reference , consumer no flags ) ; verify ( m consumer ) on new result ( m final image reference , consumer is last ) ; verify ( m memory cache , never ( ) ) cache ( any ( bitmap memory cache key class ) , any ( closeable reference class ) ) ; }


public indices aliases request builder add alias ( string index , string alias , boolean write index ) { request add alias action ( alias actions add ( ) index ( index ) alias ( alias ) write index ( write index ) ) ; return this ; }


consumes the next token from the json stream and asserts that it is the beginning of a new array

public void begin array ( ) throws i o exception { int p = peeked ; if ( p = = peeked none ) { p = do peek ( ) ; } if ( p = = peeked begin array ) { push ( json scope empty array ) ; path indices [ stack size - 1 ] = 0 ; peeked = peeked none ; } else { throw new illegal state exception ( " expected begin array but was " + peek ( ) + location string ( ) ) ; } }


returns the set of shard allocation ids that are in the in - sync set but have no assigned routing entry

public set < string > get unavailable in sync shards ( ) { return unavailable in sync shards ; }


public void write long ( long value ) { write ( ( short ) value ) ; write ( ( short ) ( value > > 16 ) ) ; write ( ( short ) ( value > > 32 ) ) ; write ( ( short ) ( value > > 48 ) ) ; }


maximum number of connections allowed from particular host ( ip )

public int get max client cnxns per host ( ) { if ( cnxn factory ! = null ) { return cnxn factory get max client cnxns per host ( ) ; } if ( secure cnxn factory ! = null ) { return secure cnxn factory get max client cnxns per host ( ) ; } return - 1 ; }


returns true if the { @ link tree file artifact } s are only stored remotely

public boolean is entirely remote ( ) { return entirely remote ; }


snapshot and restore the given serializer returns the restored serializer

public static < t > type serializer < t > snapshot and reconfigure ( type serializer < t > serializer , serializer getter < t > serializer getter ) throws i o exception { type serializer snapshot < t > config snapshot = serializer snapshot configuration ( ) ; byte [ ] serialized config ; try ( byte array output stream out = new byte array output stream ( ) ) { type serializer snapshot serialization util write serializer snapshot ( new data output view stream wrapper ( out ) , config snapshot , serializer ) ; serialized config = out to byte array ( ) ; } type serializer snapshot < t > restored config ; try ( byte array input stream in = new byte array input stream ( serialized config ) ) { restored config = type serializer snapshot serialization util read serializer snapshot ( new data input view stream wrapper ( in ) , thread current thread ( ) get context class loader ( ) , serializer getter get serializer ( ) ) ; } type serializer schema compatibility < t > strategy = restored config resolve schema compatibility ( serializer getter get serializer ( ) ) ; final type serializer < t > restored serializer ; if ( strategy is compatible as is ( ) ) { restored serializer = restored config restore serializer ( ) ; } else if ( strategy is compatible with reconfigured serializer ( ) ) { restored serializer = strategy get reconfigured serializer ( ) ; } else { throw new assertion error ( " unable to restore serializer with " + strategy ) ; } assert equals ( serializer get class ( ) , restored serializer get class ( ) ) ; return restored serializer ; }


public model view extending super class model sub class value ( int sub class value ) { on mutation ( ) ; this sub class value int = sub class value ; return this ; }


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

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


a sensible definition of { @ link # equals } in terms of { @ link # size } and { @ link # contains all } if you override either of those methods , you may wish to override { @ link # equals } to forward to this implementation

protected boolean standard equals ( @ nullable object object ) { return sets equals impl ( this , object ) ; }


gets orientation information from jpeg byte array

public static int get orientation ( byte [ ] jpeg ) { / / wrapping with byte array input stream is cheap and we don ' t have duplicate implementation return get orientation ( new byte array input stream ( jpeg ) ) ; }


protected multi value map < string , object > build response entity error model ( final invalid resource set exception e ) { return build response entity error model ( e get status ( ) , e get message ( ) ) ; }


synchronized void cache block ( long block id , string bpid , string block file name , long length , long genstamp , executor volume executor ) { extended block id key = new extended block id ( block id , bpid ) ; value prev value = mappable block map get ( key ) ; if ( prev value ! = null ) { log debug ( " block with id { } , pool { } already exists in the " + " fs dataset cache with state { } " , block id , bpid , prev value state ) ; num blocks failed to cache increment and get ( ) ; return ; } mappable block map put ( key , new value ( null , state caching ) ) ; volume executor execute ( new caching task ( key , block file name , length , genstamp ) ) ; log debug ( " initiating caching for block with id { } , pool { } " , block id , bpid ) ; }


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


remove storage dirs from data storage all storage dirs are removed even when the i o exception is thrown

synchronized void remove volumes ( final collection < storage location > storage locations ) throws i o exception { if ( storage locations is empty ( ) ) { return ; } string builder error msg builder = new string builder ( ) ; for ( iterator < storage directory > it = get storage dirs ( ) iterator ( ) ; it has next ( ) ; ) { storage directory sd = it next ( ) ; storage location sd location = sd get storage location ( ) ; if ( storage locations contains ( sd location ) ) { / / remove the block pool level storage first for ( map entry < string , block pool slice storage > entry : this bp storage map entry set ( ) ) { string bpid = entry get key ( ) ; block pool slice storage bps storage = entry get value ( ) ; file bp root = block pool slice storage get bp root ( bpid , sd get current dir ( ) ) ; bps storage remove ( bp root get absolute file ( ) ) ; } get storage dirs ( ) remove ( sd ) ; try { sd unlock ( ) ; } catch ( i o exception e ) { log warn ( " i / o error attempting to unlock storage directory { } " , sd get root ( ) , e ) ; error msg builder append ( string format ( " failed to remove % s : % s % n " , sd get root ( ) , e get message ( ) ) ) ; } } } if ( error msg builder length ( ) > 0 ) { throw new i o exception ( error msg builder to string ( ) ) ; } }


set the executor ( in the form of an { @ link event loop } ) which jmh will use this must be called before jmh requires an executor to execute objects

public static void executor ( event loop service ) { executor = service ; }