prepares the matrix that contains all offsets

public void prepare matrix offset ( boolean inverted ) { m matrix offset reset ( ) ; / / offset post translate ( m offset left , get height ( ) - m offset bottom ) ; if ( ! inverted ) m matrix offset post translate ( m view port handler offset left ( ) , m view port handler get chart height ( ) - m view port handler offset bottom ( ) ) ; else { m matrix offset set translate ( m view port handler offset left ( ) , - m view port handler offset top ( ) ) ; m matrix offset post scale ( 1 0f , - 1 0f ) ; } }


return the additional ( undeclared ) property

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


generate html for preview , using markup formatter can be called from other views

public http response do preview description ( @ query parameter string text ) throws i o exception { string writer w = new string writer ( ) ; translate ( text , w ) ; map < string , string > extra headers = collections empty map ( ) ; if ( previews set csp ) { extra headers = stream of ( " content - security - policy " , " x - web kit - csp " , " x - content - security - policy " ) collect ( collectors to map ( function identity ( ) , v - > " default - src ' none ' ; " ) ) ; } return html ( 200 , w to string ( ) , extra headers ) ; }


return the default value of the property

public string to default value ( schema p ) { if ( model utils is boolean schema ( p ) ) { if ( p get default ( ) ! = null ) { if ( boolean value of ( p get default ( ) to string ( ) ) = = false ) return " false " ; else return " true " ; } } else if ( model utils is date schema ( p ) ) { / / todo } else if ( model utils is date time schema ( p ) ) { / / todo } else if ( model utils is number schema ( p ) ) { if ( p get default ( ) ! = null ) { return p get default ( ) to string ( ) ; } } else if ( model utils is integer schema ( p ) ) { if ( p get default ( ) ! = null ) { return p get default ( ) to string ( ) ; } } else if ( model utils is string schema ( p ) ) { if ( p get default ( ) ! = null ) { if ( pattern compile ( " \ r \ n | \ r | \ n " ) matcher ( ( string ) p get default ( ) ) find ( ) ) return " ' ' ' " + p get default ( ) + " ' ' ' " ; else return " ' " + p get default ( ) + " ' " ; } } else if ( model utils is array schema ( p ) ) { if ( p get default ( ) ! = null ) { return p get default ( ) to string ( ) ; } } return null ; }


map < string , stored script source > get stored scripts ( ) { return scripts ; }


reports bytes consumed by calls to { @ link # inflate bytes } since the last invocation of this method , then resets the count to zero

int get and reset bytes consumed ( ) { int saved bytes consumed = bytes consumed ; bytes consumed = 0 ; return saved bytes consumed ; }


set the time the resource was last changed , as specified by the { @ code last - modified } header the date should be specified as the number of milliseconds since january 1 , 1970 gmt

builder < t > last modified ( instant last modified ) ;


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


logically split the set of input files for the job each { @ link input split } is then assigned to an individual { @ link mapper } for processing note : the split is a logical split of the inputs and the input files are not physically split into chunks for e g a split could be & lt ; input - file - path , start , offset & gt ; tuple the input format also creates the { @ link record reader } to read the { @ link input split }

list < input split > get splits ( job context context ) throws i o exception , interrupted exception ;


< code > perform merge instruction < code > merges the indicated instruction into the merge program before the instruction is created the bytes for the instruction are copied from program 2 to program 1 corresponding code unit ( s ) must already be cleared in result program , as well as having copied context - register value

private void perform merge instruction ( instruction origin instruction , address set view origin byte diffs ) throws memory access exception { address origin min = origin instruction get min address ( ) ; address result min = origin to result translator get address ( origin min ) ; if ( origin instruction is in delay slot ( ) ) { / / delay slots must be created as part of its delay - slotted predecessor instruction result inst = result listing get instruction at ( result min ) ; if ( result inst ! = null & & result inst is in delay slot ( ) ) { copy instruction attributes ( origin instruction , result inst ) ; } return ; } int bytes length ; address origin max ; if ( origin instruction get delay slot depth ( ) ! = 0 ) { / / must include delay slots for byte copy origin max = simple diff utility get end of delay slots ( origin instruction ) ; bytes length = ( int ) origin max subtract ( origin min ) ; } else { origin max = origin instruction get max address ( ) ; bytes length = origin instruction get length ( ) ; } address result max = origin to result translator get address ( origin max ) ; memory block result block = result program get memory ( ) get block ( result min ) ; boolean initialized bytes = ( result block ! = null ) ? result block is initialized ( ) : false ; if ( ! initialized bytes ) { info msg append ( " diff / merge can ' t apply instruction from " + origin min + " to " + result min + " since it needs initialized memory " ) ; return ; } / / if there are byte differences for this instruction then the / / bytes need to get copied even though the user did not indicate to if ( bytes are different ( origin byte diffs , origin min , result min , bytes length ) ) { / / fixme / / copy all the bytes for the instruction if any bytes differ program memory util copy bytes in ranges ( result program , origin program , result min , result max ) ; } instruction new inst ; if ( origin instruction get delay slot depth ( ) ! = 0 ) { new inst = disassemble delay slotted instruction ( result program , result min ) ; } else { new inst = disassemble non delay slot instruction ( result program , result min ) ; } if ( new inst = = null ) { return ; } copy instruction attributes ( origin instruction , new inst ) ; }


access to request body matchers using a < a href = " https : github comjayway json path " > json path expression to inspect a specific subset of the body and a hamcrest match for asserting the value found at the json path

public static < t > request matcher json path ( string expression , matcher < ? super t > matcher ) { return new json path request matchers ( expression ) value ( matcher ) ; }


public byte [ ] get table name ( ) { return this table name ; }


records a miss when the hot set is not full

private void on lir warmup miss ( node node ) { node move to top ( stack type s ) ; node status = status lir ; size hot + + ; }


registers that this { @ link task thread } is run for the specified { @ link task action } this can be explicitly called from subtypes to associate a single { @ link task thread } across multiple tag actions

protected final void associate with ( task action action ) { action worker thread = this ; action log = new weak reference < > ( log ) ; }


increments the number of total and in progress checkpoints

void increment in progress checkpoints ( ) { num in progress checkpoints + + ; num total checkpoints + + ; }


protected void serialize ( data tree dt , map < long , integer > sessions , output archive oa , file header header ) throws i o exception { / / this is really a programmatic error and not something that can / / happen at runtime if ( header = = null ) { throw new illegal state exception ( " snapshot ' s not open for writing : uninitialized header " ) ; } header serialize ( oa , " fileheader " ) ; serialize utils serialize snapshot ( dt , oa , sessions ) ; }


returns a string representation of { @ code iterator } , with the format { @ code [ e 1 , e 2 , , en ] } the iterator will be left exhausted : its { @ code has next ( ) } method will return { @ code false }

public static string to string ( iterator < ? > iterator ) { string builder sb = new string builder ( ) append ( ' [ ' ) ; boolean first = true ; while ( iterator has next ( ) ) { if ( ! first ) { sb append ( " , " ) ; } first = false ; sb append ( iterator next ( ) ) ; } return sb append ( ' ] ' ) to string ( ) ; }


create a new key common to all child r rs

protected k create key ( ) { if ( keyclass = = null | | keyclass equals ( null writable class ) ) { return ( k ) null writable get ( ) ; } return ( k ) reflection utils new instance ( keyclass , get conf ( ) ) ; }


gets the backend distribution for r p cs sent by a test client

public com google common util concurrent listenable future < io grpc testing integration messages load balancer stats response > get client stats ( io grpc testing integration messages load balancer stats request request ) { return io grpc stub client calls future unary call ( get channel ( ) new call ( get get client stats method ( ) , get call options ( ) ) , request ) ; }


test to check correct values of read and write throttling statistics in { @ code abfs client throttling analyzer }

public void test abfs throttling statistics ( ) throws i o exception { describe ( " test to check correct values of read throttle and write " + " throttle statistics in abfs " ) ; abfs counters statistics = new abfs counters impl ( get file system ( ) get uri ( ) ) ; / * * calling the throttle methods to check correct summation and values of * the counters * / for ( int i = 0 ; i < large operations ; i + + ) { statistics increment counter ( abfs statistic read throttles , 1 ) ; statistics increment counter ( abfs statistic write throttles , 1 ) ; } map < string , long > metric map = statistics to map ( ) ; / * * test to check read and write throttle statistics gave correct values for * 1000 calls * / assert abfs statistics ( abfs statistic read throttles , large operations , metric map ) ; assert abfs statistics ( abfs statistic write throttles , large operations , metric map ) ; }


provides the worker event group loop to the server it ' s an optional parameter if the user has not provided one when the server is built , the builder will create one you must also provide corresponding { @ link io netty channel channel } type using { @ link # channel type ( class ) } and { @ link # boss event loop group ( event loop group ) } for example , { @ link nio server socket channel } must use { @ link io netty channel nio nio event loop group } for both boss and worker { @ link event loop group } , otherwise your server won ' t start the server won ' t take ownership of the given event loop group it ' s caller ' s responsibility to shut it down when it ' s desired grpc uses non - daemon { @ link thread } s by default and thus a { @ link io grpc server } will continue to run even after the main thread has terminated however , users have to be cautious when providing their own { @ link event loop group } s for example , netty ' s { @ link event loop group } s use daemon threads by default and thus an application with only daemon threads running besides the main thread will exit as soon as the main thread completes a simple solution to this problem is to call { @ link io grpc server # await termination ( ) } to keep the main thread alive until the server has terminated

public netty server builder worker event loop group ( event loop group group ) { if ( group ! = null ) { return worker event loop group pool ( new fixed object pool < > ( group ) ) ; } return worker event loop group pool ( default worker event loop group pool ) ; }


records entry to a { @ code load ( ) } , throwing an exception if a cycle is detected

private void begin load ( bzl load value key key ) throws bzl load failed exception { if ( ! load stack add ( key ) ) { immutable list < bzl load value key > cycle = cycle utils split into path and chain ( predicates equal to ( key ) , load stack ) second ; throw new bzl load failed exception ( " starlark load cycle : " + cycle , code cycle ) ; } }


returns true if the socket mode has been determined to be tls

public boolean is secure socket ( ) { return mode = = mode tls ; }


create a new { @ link cluster node } as universal statistic node for a single resource


fetch any sessions in the given range of keys and the sessions end is & ge ; earliest session end time and the sessions start is & le ; latest session start time iterating from earliest to latest this iterator must be closed after use

default key value iterator < windowed < k > , agg > find sessions ( final k key from , final k key to , final long earliest session end time , final long latest session start time ) { throw new unsupported operation exception ( " this api is not supported by this implementation of read only session store " ) ; }


calls { @ link setupable stream operator # setup ( stream task , stream config , output ) } ( ) }

public void setup ( ) { setup ( null ) ; }


places focus in the first focusable component within this panel

public void request focus ( ) { swing utilities invoke later ( new runnable ( ) { public void run ( ) { keyboard focus manager kfm = keyboard focus manager get current keyboard focus manager ( ) ; kfm focus next component ( edit reference panel this ) ; } } ) ; }


returns the { @ link selector provider } used by this { @ link nio event loop } to obtain the { @ link selector }

public selector provider selector provider ( ) { return provider ; }


check plan for generic type info ' s and register the types at the serializers

private void register generic type info if configured ( plan plan ) { if ( ! config is auto type registration disabled ( ) ) { plan accept ( new visitor < operator < ? > > ( ) { private final set < class < ? > > registered types = new hash set < > ( ) ; private final set < org apache flink api common operators operator < ? > > visited operators = new hash set < > ( ) ; @ override public boolean pre visit ( org apache flink api common operators operator < ? > visitable ) { if ( ! visited operators add ( visitable ) ) { return false ; } operator information < ? > op info = visitable get operator info ( ) ; serializers recursively register type ( op info get output type ( ) , config , registered types ) ; return true ; } @ override public void post visit ( org apache flink api common operators operator < ? > visitable ) { } } ) ; } }


set the offset on this builder , which is a number of milliseconds , and return the builder so that calls can be chained

public date histogram aggregation builder offset ( long offset ) { this offset = offset ; return this ; }


public date parse date ( string str ) { try { return date format parse ( str ) ; } catch ( parse exception e ) { throw new runtime exception ( e ) ; } }


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

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


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

public abstract epoxy model with view on visibility changed ( on model visibility changed listener < abstract epoxy model with view , view > listener ) { on mutation ( ) ; this on model visibility changed listener epoxy generated model = listener ; return this ; }


this method will " expand " the type arguments of the given type , only if the type is a { @ link class names # diff } or a { @ link java util collection } otherwise the type arguments won ' t be traversed and recorded

public static type spec generate type spec ( type mirror type ) { final type spec default value = new type spec ( safely get type name ( type ) , type get kind ( ) ! = type kind error ) ; return type accept ( new simple type visitor 6 < type spec , void > ( default value ) { @ override public type spec visit declared ( declared type t , void a void ) { final type element type element = ( type element ) t as element ( ) ; final string qualified name = type element get qualified name ( ) to string ( ) ; final supplier < type spec > superclass = new simple memoizing supplier < > ( ( ) - > { final type mirror mirror = type element get superclass ( ) ; return mirror get kind ( ) ! = type kind declared ? null : generate type spec ( mirror ) ; } ) ; final supplier < immutable list < type spec > > superinterfaces = new simple memoizing supplier < > ( ( ) - > { final list < ? extends type mirror > mirrors = type element get interfaces ( ) ; return immutable list copy of ( mirrors ! = null & & ! mirrors is empty ( ) ? mirrors stream ( ) filter ( mirror - > mirror get kind ( ) = = type kind declared ) map ( spec model utils : : generate type spec ) collect ( collectors to list ( ) ) : collections empty list ( ) ) ; } ) ; final supplier < immutable list < type spec > > type arguments = new simple memoizing supplier < > ( ( ) - > immutable list copy of ( class name best guess ( qualified name ) equals ( class names diff ) | | superinterfaces get ( ) stream ( ) any match ( type spec - > type spec is sub interface ( class names collection ) ) ? ( ( declared type ) type ) get type arguments ( ) stream ( ) map ( spec model utils : : generate type spec ) collect ( collectors to list ( ) ) : collections empty list ( ) ) ) ; return new type spec declared type spec ( safely get type name ( t ) , qualified name , superclass , superinterfaces , type arguments ) ; } } , null ) ; }


convert a utf - 8 encoded byte array back into a string

public static string from bytes ( byte [ ] bytes ) throws i o exception { data input buffer dbuf = new data input buffer ( ) ; dbuf reset ( bytes , 0 , bytes length ) ; string builder buf = new string builder ( bytes length ) ; read chars ( dbuf , buf , bytes length ) ; return buf to string ( ) ; }


can be overridden by aggregator implementation to be called back when the collection phase starts

protected void do pre collection ( ) throws i o exception { }


returns { @ code x mod m } , a non - negative value less than { @ code m } this differs from { @ code x % m } , which might be negative for example : { @ code mod ( 7 , 4 ) = = 3 mod ( - 7 , 4 ) = = 1 mod ( - 1 , 4 ) = = 3 mod ( - 8 , 4 ) = = 0 mod ( 8 , 4 ) = = 0 }

public static int mod ( int x , int m ) { if ( m < = 0 ) { throw new arithmetic exception ( " modulus " + m + " must be > 0 " ) ; } int result = x % m ; return ( result > = 0 ) ? result : result + m ; }


return shut down future of this runner the shut down future is being completed with the final { @ link application status } once the runner wants to shut down

completable future < application status > get shut down future ( ) ;


find the nodes containing the given group

private program node [ ] find nodes ( group g ) { array list < program node > list = new array list < > ( ) ; for ( int i = 0 ; i < node list size ( ) ; i + + ) { program node node = node list get ( i ) ; group group = node get group ( ) ; if ( group ! = null & & group equals ( g ) ) { list add ( node ) ; } } program node [ ] nodes = new program node [ list size ( ) ] ; return list to array ( nodes ) ; }


public < t > t get parcelable ( @ non null final string key , @ non null final parcelable creator < t > creator , final t default value ) { t value = m cache memory utils get ( key ) ; if ( value ! = null ) return value ; return m cache disk utils get parcelable ( key , creator , default value ) ; }


post usercreate with list : creates list of users with given input array

default response entity < void > create users with list input ( @ api param ( value = " list of user object " , required = true ) @ valid @ request body list < user > body ) { return new response entity < > ( http status not implemented ) ; }


public insn with new registers ( register spec result , register spec list sources ) { return new throwing insn ( get opcode ( ) , get position ( ) , sources , catches ) ; }


increases the size of the keys array and the indexer this method needs to be very careful ! it is very important that the keys get mapped to the same key index even though they are stored in a different list in the indexer class ( which is indexed based on the hashcode ( mod capacity ) of the key since this method can only be called when the indexer is full , we can assume that there are no gaps ( freed indexes ) in the keys array therefore , if we clear everything and add them back in the same order that they were stored in the old keys array , they should be assigned the same index this is important since other containing classes may be storing lots of information based on this index and we don ' t want the indexing to change just because we had to grow

private void grow ( ) { int new capacity = prime next prime ( indexer get new capacity ( ) ) ; indexer grow capacity ( new capacity ) ; indexer grow num lists ( new capacity ) ; indexer clear ( ) ; int [ ] old keys = keys ; keys = new int [ new capacity ] ; capacity = new capacity ; for ( int old key : old keys ) { put ( old key ) ; } }


public void execute request ( ) { if ( bulk request number of actions ( ) = = 0 ) { return ; } logger trace ( " [ { } ] es api call : bulk request with { } actions " , job id , bulk request number of actions ( ) ) ; try ( thread context stored context ignore = client thread pool ( ) get thread context ( ) stash with origin ( ml origin ) ) { bulk response add records response = client bulk ( bulk request ) action get ( ) ; if ( add records response has failures ( ) ) { logger error ( " [ { } ] bulk index of results has errors : { } " , job id , add records response build failure message ( ) ) ; } } bulk request = new bulk request ( ) ; }


get check task type , refer to enum health check type


returns all the host names associated by the default nameserver with the address bound to the specified network interface

public static string [ ] get hosts ( string str interface ) throws unknown host exception { return get hosts ( str interface , null , false ) ; }


selects the pivot to use , namely the median of the values at { @ code from } , { @ code to } , and halfway between the two ( rounded down ) , from { @ code array } , and ensure ( by swapping elements if necessary ) that that pivot value appears at the start of the slice i e at { @ code from } expects that { @ code from } is strictly less than { @ code to }

private static void move pivot to start of slice ( double [ ] array , int from , int to ) { int mid = ( from + to ) > > > 1 ; / / we want to make a swap such that either array [ to ] < = array [ from ] < = array [ mid ] , or / / array [ mid ] < = array [ from ] < = array [ to ] we know that from < to , so we know mid < to / / ( although it ' s possible that mid = = from , if to = = from + 1 ) note that the postcondition / / would be impossible to fulfil if mid = = to unless we also have array [ from ] = = array [ to ] boolean to less than mid = ( array [ to ] < array [ mid ] ) ; boolean mid less than from = ( array [ mid ] < array [ from ] ) ; boolean to less than from = ( array [ to ] < array [ from ] ) ; if ( to less than mid = = mid less than from ) { / / either array [ to ] < array [ mid ] < array [ from ] or array [ from ] < = array [ mid ] < = array [ to ] swap ( array , mid , from ) ; } else if ( to less than mid ! = to less than from ) { / / either array [ from ] < = array [ to ] < array [ mid ] or array [ mid ] < = array [ to ] < array [ from ] swap ( array , from , to ) ; } / / the postcondition now holds so the median , our chosen pivot , is at from }


return the generic type of the { @ code return type } ( or of the nested type if it is an { @ link http entity } )

private type get generic type ( method parameter return type ) { if ( http entity class is assignable from ( return type get parameter type ( ) ) ) { return resolvable type for type ( return type get generic parameter type ( ) ) get generic ( ) get type ( ) ; } else { return return type get generic parameter type ( ) ; } }


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


formats an { @ code int } as a 4 - byte signed hex value

public static string s 4 ( int v ) { char [ ] result = new char [ 9 ] ; if ( v < 0 ) { result [ 0 ] = ' - ' ; v = - v ; } else { result [ 0 ] = ' + ' ; } for ( int i = 0 ; i < 8 ; i + + ) { result [ 8 - i ] = character for digit ( v & 0x 0f , 16 ) ; v > > = 4 ; } return new string ( result ) ; }


returns a range that contains all values strictly greater than { @ code lower } and strictly less than { @ code upper }

public static < c extends comparable < ? > > range < c > open ( c lower , c upper ) { return create ( cut above value ( lower ) , cut below value ( upper ) ) ; }


updated user this can only be done by the logged in user

public void update user ( string username , user body , api client auth info auth info , handler < async result < void > > result handler ) { object local var body = body ; / / verify the required parameter ' username ' is set if ( username = = null ) { result handler handle ( api exception fail ( 400 , " missing the required parameter ' username ' when calling update user " ) ) ; return ; } / / verify the required parameter ' body ' is set if ( body = = null ) { result handler handle ( api exception fail ( 400 , " missing the required parameter ' body ' when calling update user " ) ) ; return ; } / / create path and map variables string local var path = " / user / { username } " replace all ( " \ \ { " + " username " + " \ \ } " , encode parameter ( username to string ( ) ) ) ; / / query params list < pair > local var query params = new array list < > ( ) ; / / header params multi map local var header params = multi map case insensitive multi map ( ) ; / / cookie params multi map local var cookie params = multi map case insensitive multi map ( ) ; / / form params / / todo : sending files within multipart / form - data is not supported yet ( because of vertx web - client ) map < string , object > local var form params = new hash map < > ( ) ; string [ ] local var accepts = { } ; string [ ] local var content types = { } ; string [ ] local var auth names = new string [ ] { } ; api client invoke a p i ( local var path , " put " , local var query params , local var body , local var header params , local var cookie params , local var form params , local var accepts , local var content types , local var auth names , auth info , null , result handler ) ; }


returns true if this future was cancelled with { @ code may interrupt if running } set to { @ code true }

protected final boolean was interrupted ( ) { final object local value = value ; return ( local value instanceof cancellation ) & & ( ( cancellation ) local value ) was interrupted ; }


protected void start extract ( g file system fs , g file src dir , task monitor monitor ) throws cancelled exception , i o exception { this fs = fs ; if ( src dir = = null ) { src dir = fs lookup ( null ) ; } process directory ( src dir , root output directory , monitor ) ; }


create a rpc service for the task manager

static rpc service create rpc service ( final configuration configuration , final high availability services ha services ) throws exception { check not null ( configuration ) ; check not null ( ha services ) ; return akka rpc service utils create remote rpc service ( configuration , determine task manager bind address ( configuration , ha services ) , configuration get string ( task manager options rpc port ) , configuration get string ( task manager options bind host ) , configuration get optional ( task manager options rpc bind port ) ) ; }


set the { @ link encoding mode encoding mode } to use by default this is set to { @ link encoding mode # template and values encoding mode template and values } note : prior to 5 1 the default was { @ link encoding mode # uri component encoding mode uri component } therefore the { @ code web client } { @ code rest template } have switched their default behavior

public void set encoding mode ( encoding mode encoding mode ) { this encoding mode = encoding mode ; }


tests { @ link partition request queue # enqueue available reader ( network sequence view reader ) } , verifying the reader would be enqueued in the pipeline if the next sending buffer is an event even though it has no available credits

public void test enqueue reader by notifying event buffer ( ) throws exception { / / setup final result subpartition view view = new next is event result subpartition view ( ) ; result partition provider partition provider = ( partition id , index , availability listener ) - > view ; final input channel i d receiver id = new input channel i d ( ) ; final partition request queue queue = new partition request queue ( ) ; final credit based sequence numbering view reader reader = new credit based sequence numbering view reader ( receiver id , 0 , queue ) ; final embedded channel channel = new embedded channel ( queue ) ; reader request subpartition view ( partition provider , new result partition i d ( ) , 0 ) ; / / block the channel so that we see an intermediate state in the test byte buf channel blocking buffer = block channel ( channel ) ; assert null ( channel read outbound ( ) ) ; / / notify an available event buffer to trigger enqueue the reader reader notify data available ( ) ; channel run pending tasks ( ) ; / / the reader is enqueued in the pipeline because the next buffer is an event , even though / / no credits are available assert that ( queue get available readers ( ) , contains ( reader ) ) ; / / contains only ( this ) one ! assert equals ( 0 , reader get num credits available ( ) ) ; / / flush the buffer to make the channel writable again and see the final results channel flush ( ) ; assert same ( channel blocking buffer , channel read outbound ( ) ) ; assert equals ( 0 , queue get available readers ( ) size ( ) ) ; assert equals ( 0 , reader get num credits available ( ) ) ; assert null ( channel read outbound ( ) ) ; }


protected void draw linear ( canvas c , i line data set data set ) { int entry count = data set get entry count ( ) ; final boolean is draw stepped enabled = data set is draw stepped enabled ( ) ; final int points per entry pair = is draw stepped enabled ? 4 : 2 ; transformer trans = m chart get transformer ( data set get axis dependency ( ) ) ; float phase y = m animator get phase y ( ) ; m render paint set style ( paint style stroke ) ; canvas canvas = null ; / / if the data - set is dashed , draw on bitmap - canvas if ( data set is dashed line enabled ( ) ) { canvas = m bitmap canvas ; } else { canvas = c ; } m x bounds set ( m chart , data set ) ; / / if drawing filled is enabled if ( data set is draw filled enabled ( ) & & entry count > 0 ) { draw linear fill ( c , data set , trans , m x bounds ) ; } / / more than 1 color if ( data set get colors ( ) size ( ) > 1 ) { int number of floats = points per entry pair * 2 ; if ( m line buffer length < = number of floats ) m line buffer = new float [ number of floats * 2 ] ; int max = m x bounds min + m x bounds range ; for ( int j = m x bounds min ; j < max ; j + + ) { entry e = data set get entry for index ( j ) ; if ( e = = null ) continue ; m line buffer [ 0 ] = e get x ( ) ; m line buffer [ 1 ] = e get y ( ) * phase y ; if ( j < m x bounds max ) { e = data set get entry for index ( j + 1 ) ; if ( e = = null ) break ; if ( is draw stepped enabled ) { m line buffer [ 2 ] = e get x ( ) ; m line buffer [ 3 ] = m line buffer [ 1 ] ; m line buffer [ 4 ] = m line buffer [ 2 ] ; m line buffer [ 5 ] = m line buffer [ 3 ] ; m line buffer [ 6 ] = e get x ( ) ; m line buffer [ 7 ] = e get y ( ) * phase y ; } else { m line buffer [ 2 ] = e get x ( ) ; m line buffer [ 3 ] = e get y ( ) * phase y ; } } else { m line buffer [ 2 ] = m line buffer [ 0 ] ; m line buffer [ 3 ] = m line buffer [ 1 ] ; } / / determine the start and end coordinates of the line , and make sure they differ float first coordinate x = m line buffer [ 0 ] ; float first coordinate y = m line buffer [ 1 ] ; float last coordinate x = m line buffer [ number of floats - 2 ] ; float last coordinate y = m line buffer [ number of floats - 1 ] ; if ( first coordinate x = = last coordinate x & & first coordinate y = = last coordinate y ) continue ; trans point values to pixel ( m line buffer ) ; if ( ! m view port handler is in bounds right ( first coordinate x ) ) break ; / / make sure the lines don ' t do shitty things outside / / bounds if ( ! m view port handler is in bounds left ( last coordinate x ) | | ! m view port handler is in bounds top ( math max ( first coordinate y , last coordinate y ) ) | | ! m view port handler is in bounds bottom ( math min ( first coordinate y , last coordinate y ) ) ) continue ; / / get the color that is set for this line - segment m render paint set color ( data set get color ( j ) ) ; canvas draw lines ( m line buffer , 0 , points per entry pair * 2 , m render paint ) ; } } else { / / only one color per dataset if ( m line buffer length < math max ( ( entry count ) * points per entry pair , points per entry pair ) * 2 ) m line buffer = new float [ math max ( ( entry count ) * points per entry pair , points per entry pair ) * 4 ] ; entry e 1 , e 2 ; e 1 = data set get entry for index ( m x bounds min ) ; if ( e 1 ! = null ) { int j = 0 ; for ( int x = m x bounds min ; x < = m x bounds range + m x bounds min ; x + + ) { e 1 = data set get entry for index ( x = = 0 ? 0 : ( x - 1 ) ) ; e 2 = data set get entry for index ( x ) ; if ( e 1 = = null | | e 2 = = null ) continue ; m line buffer [ j + + ] = e 1 get x ( ) ; m line buffer [ j + + ] = e 1 get y ( ) * phase y ; if ( is draw stepped enabled ) { m line buffer [ j + + ] = e 2 get x ( ) ; m line buffer [ j + + ] = e 1 get y ( ) * phase y ; m line buffer [ j + + ] = e 2 get x ( ) ; m line buffer [ j + + ] = e 1 get y ( ) * phase y ; } m line buffer [ j + + ] = e 2 get x ( ) ; m line buffer [ j + + ] = e 2 get y ( ) * phase y ; } if ( j > 0 ) { trans point values to pixel ( m line buffer ) ; final int size = math max ( ( m x bounds range + 1 ) * points per entry pair , points per entry pair ) * 2 ; m render paint set color ( data set get color ( ) ) ; canvas draw lines ( m line buffer , 0 , size , m render paint ) ; } } } m render paint set path effect ( null ) ; }


create a unique identifier for the watch and cluster

private static string create unique watch id ( final string cluster uuid , final string watch id ) { return cluster uuid + " " + watch id ; }


encoding overhead is thrift type plus 32 - bit length prefix

static < t > int list size in bytes ( write buffer writer < t > writer , list < t > values ) { int size in bytes = 5 ; for ( int i = 0 , length = values size ( ) ; i < length ; i + + ) { size in bytes + = writer size in bytes ( values get ( i ) ) ; } return size in bytes ; }


public histogram values source builder interval ( double interval ) { if ( interval < = 0 ) { throw new illegal argument exception ( " [ interval ] must be greater than 0 for [ histogram ] source " ) ; } this interval = interval ; return this ; }


log all x509 certificates contained within array


sets the number of tasks that a spawned task jvm should run before it exits

public void set num tasks to execute per jvm ( int num tasks ) { set int ( job context jvm numtasks torun , num tasks ) ; }


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


creates a new , empty { @ code hash multimap } with the default initial capacities this method will soon be deprecated in favor of { @ code multimap builder hash keys ( ) hash set values ( ) build ( ) }

public static < k , v > hash multimap < k , v > create ( ) { return new hash multimap < > ( ) ; }


return the configured uri template handler

public uri template handler get uri template handler ( ) { return this sync template get uri template handler ( ) ; }


determine whether to use request dispatcher ' s { @ code include } or { @ code forward } method performs a check whether an include uri attribute is found in the request , indicating an include request , and whether the response has already been committed in both cases , an include will be performed , as a forward is not possible anymore

protected boolean use include ( http servlet request request , http servlet response response ) { return ( this always include | | web utils is include request ( request ) | | response is committed ( ) ) ; }


public void add ( single pending commit commit ) { commits add ( commit ) ; / / add any statistics i o statistics snapshot st = commit get i o statistics ( ) ; if ( st ! = null ) { iostats aggregate ( st ) ; st clear ( ) ; } }


starts multiple nodes with the given settings and returns their names

public list < string > start nodes ( int num of nodes , settings settings ) { return start nodes ( collections n copies ( num of nodes , settings ) to array ( new settings [ 0 ] ) ) ; }


query given sql to create a prepared statement from sql and a prepared statement setter implementation that knows how to bind values to the query , reading the result set on a per - row basis with a row callback handler

void query ( string sql , @ nullable prepared statement setter pss , row callback handler rch ) throws data access exception ;


if - - enable platform specific config is true and the corresponding config definition exists , we should enable the platform specific config

private static boolean should enable platform specific config ( option value description enable platform specific config description , list multimap < string , rc chunk of args > command to rc args , list < string > commands to parse ) { if ( enable platform specific config description = = null | | ! ( boolean ) enable platform specific config description get value ( ) ) { return false ; } for ( string command name : commands to parse ) { string default config def = command name + " : " + get platform name ( ) ; if ( command to rc args contains key ( default config def ) ) { return true ; } } return false ; }


fetch a list of r rs corresponding to the extent the app is starved ( fairshare and minshare ) this method considers the number of containers in a rr and also only one locality - level ( the first encountered resource name )

list < resource request > get starved resource requests ( ) { / / list of r rs we build in this method to return list < resource request > ret = new array list < > ( ) ; / / track visited r rs to avoid the same rr at multiple locality levels visited resource request tracker visited r rs = new visited resource request tracker ( scheduler get node tracker ( ) ) ; / / start with current starvation and track the pending amount resource pending = get starvation ( ) ; for ( resource request rr : app scheduling info get all resource requests ( ) ) { if ( resources is none ( pending ) ) { / / found enough r rs to match the starvation break ; } / / see if we have already seen this rr if ( ! visited r rs visit ( rr ) ) { continue ; } / / a rr can have multiple containers of a capability we need to / / compute the number of containers that fit in " pending " int num containers that fit = ( int ) math floor ( resources ratio ( scheduler get resource calculator ( ) , pending , rr get capability ( ) ) ) ; if ( num containers that fit = = 0 ) { / / this rr ' s capability is too large to fit in pending continue ; } / / if the rr is only partially being satisfied , include only the / / partial number of containers if ( num containers that fit < rr get num containers ( ) ) { rr = resource request new instance ( rr get priority ( ) , rr get resource name ( ) , rr get capability ( ) , num containers that fit ) ; } / / add the rr to return list and adjust " pending " accordingly ret add ( rr ) ; resources subtract from non negative ( pending , resources multiply ( rr get capability ( ) , rr get num containers ( ) ) ) ; } return ret ; }


verify the size of the executor ' s queue , by verifying that the first submission to block is { @ code expected queue size + 1 }

protected void verify queue size ( executor service executor service , int expected queue size ) { count down latch latch = new count down latch ( 1 ) ; for ( int i = 0 ; i < expected queue size ; i + + ) { executor service submit ( new latched sleeper ( latch ) ) ; } stop watch stop watch = new stop watch ( ) start ( ) ; latch count down ( ) ; executor service submit ( sleeper ) ; assert did block ( stop watch ) ; }


sets the length of a subblock ( used by the split command )

protected void set length ( long length ) throws i o exception { this sub block length = length ; record set long value ( memory map d b adapter sub length col , length ) ; adapter update sub block record ( record ) ; }


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

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


resources names of resources that have be deleted and to be removed from the mcp client removed resources for missing resources can be ignored < code > repeated string removed resources = 3 ; < code >

public com google protobuf byte string get removed resources bytes ( int index ) { return removed resources get byte string ( index ) ; }


tests that a job can be re - executed after the job has failed due to a task executor termination

public void test job re execution after task executor termination ( ) throws exception { final job graph job graph = create job graph ( parallelism ) ; final completable future < job result > job result future = submit job and wait until running ( job graph ) ; / / kill one task executor which should fail the job execution mini cluster terminate task manager ( 0 ) ; final job result job result = job result future get ( ) ; assert that ( job result is success ( ) , is ( false ) ) ; mini cluster start task manager ( ) ; final job graph new job graph = create job graph ( parallelism ) ; blocking operator unblock ( ) ; mini cluster submit job ( new job graph ) get ( ) ; mini cluster request job result ( new job graph get job i d ( ) ) get ( ) ; }


flushes the state of the engine including the transaction log , clearing memory and persisting documents in the lucene index to disk including a potentially heavy and durable fsync operation this operation is not going to block if another flush operation is currently running and won ' t write a lucene commit if nothing needs to be committed

public final void flush ( ) throws engine exception { flush ( false , false ) ; }


choose a machine in runtime according to the cluster status

private machine choose machine ( configuration conf ) throws i o exception { final int parts = conf get int ( n parts , integer max value ) ; try { for ( ; ; thread sleep ( 2000 ) ) { / / get cluster status final cluster metrics status = cluster get cluster status ( ) ; final int m = status get map slot capacity ( ) - status get occupied map slots ( ) ; final int r = status get reduce slot capacity ( ) - status get occupied reduce slots ( ) ; if ( m > = parts | | r > = parts ) { / / favor reduce side machine final machine value = r > = parts ? reduce side instance : map side instance ; util out println ( " " + this + " is " + value + " ( m = " + m + " , r = " + r + " ) " ) ; return value ; } } } catch ( interrupted exception e ) { throw new i o exception ( e ) ; } }


returns an open { @ link program } instance that matches the specified { @ link fsrl } , either from the set of currently open programs , or by requesting the specified { @ link program manager } to open a { @ link domain file } that was found to match this g file

public static program find matching program open if needed ( fsrl fsrl , object consumer , program manager program manager , int open state ) { return find matching program open if needed ( fsrl , null , consumer , program manager , open state ) ; }


load bean definitions from the specified xml file

public int load bean definitions ( encoded resource encoded resource ) throws bean definition store exception { assert not null ( encoded resource , " encoded resource must not be null " ) ; if ( logger is trace enabled ( ) ) { logger trace ( " loading xml bean definitions from " + encoded resource ) ; } set < encoded resource > current resources = this resources currently being loaded get ( ) ; if ( ! current resources add ( encoded resource ) ) { throw new bean definition store exception ( " detected cyclic loading of " + encoded resource + " - check your import definitions ! " ) ; } try ( input stream input stream = encoded resource get resource ( ) get input stream ( ) ) { input source input source = new input source ( input stream ) ; if ( encoded resource get encoding ( ) ! = null ) { input source set encoding ( encoded resource get encoding ( ) ) ; } return do load bean definitions ( input source , encoded resource get resource ( ) ) ; } catch ( i o exception ex ) { throw new bean definition store exception ( " i o exception parsing xml document from " + encoded resource get resource ( ) , ex ) ; } finally { current resources remove ( encoded resource ) ; if ( current resources is empty ( ) ) { this resources currently being loaded remove ( ) ; } } }


public long get heap usage ( ) { return heap usage ; }


appends an optimized { @ code short array } value to the stream as an optimized array , the { @ code int 1 6 } value type marker and element count are encoded once at the array marker instead of repeating the type marker for each element

public u b json writer value ( short [ ] values ) throws i o exception { array ( ) ; out write byte ( ' $ ' ) ; out write byte ( ' i ' ) ; out write byte ( ' # ' ) ; value ( values length ) ; for ( int i = 0 , n = values length ; i < n ; i + + ) { out write short ( values [ i ] ) ; } pop ( true ) ; return this ; }


returns a middleman for all the files in crosstool

public nested set < artifact > get all files middleman ( ) { return all files middleman ; }


aggressive non - concurrent cache good for non - shared cache , when we ' re not worried about class unloading

public static class resolver soft caching resolver ( class loader class loader ) { return new caching class resolver ( new class loader class resolver ( default class loader ( class loader ) ) , new soft reference map < string , class < ? > > ( new hash map < string , reference < class < ? > > > ( ) ) ) ; }


send close connection packet to the client

public void send close session ( ) { send buffer ( server cnxn factory close conn ) ; }


bytes to preallocate on the " request " breaker for this aggregation the goal is to request a few more bytes than we expect to use at first to cut down on contention on the " request " breaker when we are constructing the aggs underestimating what we allocate up front will fail to accomplish the goal overestimating will cause requests to fail for no reason

public long bytes to preallocate ( ) { return default preallocation ; }


public static void create table ( database db , boolean if not exists ) { string constraint = if not exists ? " if not exists " : " " ; db exec s q l ( " create table " + constraint + " \ " simple entity not null \ " ( " + / / " \ " id \ " integer primary key not null , " + / / 0 : id " \ " simple boolean \ " integer not null , " + / / 1 : simple boolean " \ " simple byte \ " integer not null , " + / / 2 : simple byte " \ " simple short \ " integer not null , " + / / 3 : simple short " \ " simple int \ " integer not null , " + / / 4 : simple int " \ " simple long \ " integer not null , " + / / 5 : simple long " \ " simple float \ " real not null , " + / / 6 : simple float " \ " simple double \ " real not null , " + / / 7 : simple double " \ " simple string \ " text not null , " + / / 8 : simple string " \ " simple byte array \ " blob not null ) ; " ) ; / / 9 : simple byte array }


public j s o n object execute ( file system fs ) throws i o exception { boolean ret = fs set replication ( path , replication ) ; j s o n object json = new j s o n object ( ) ; json put ( http f s file system set replication json , ret ) ; return json ; }


public int get column ( ) { return column ; }


a simple method to test that the tables of the " instruction info " dialog contain data

private boolean component provider tables have data ( ) { object [ ] data = get component provider table data ( true ) ; return ( ( data [ 0 ] ! = null ) & & ! " - - no instruction - - " equals ( data [ 0 ] ) ) | | ( data [ 1 ] ! = null ) ; }


adds a buffer to a priority queue in log ( size ) time if one tries to add more objects than max size from initialize a runtime exception ( array index out of bound ) is thrown

public final void put ( t element ) { size + + ; heap [ size ] = element ; up heap ( ) ; }


private boolean r ( exception e ) throws exception { throw e ; }


create a new { @ link form field part } with the given parameters

public static form field part form field part ( http headers headers , string value ) { assert not null ( headers , " headers must not be null " ) ; assert not null ( value , " value must not be null " ) ; return new default form field part ( headers , value ) ; }


configure the intercepting point around instance method

public instance method point builder around instance method ( final element matcher < ? super method description > matcher ) { return new instance method point builder ( this , matcher ) ; }


returns an immutable snapshot of the statistics on the { @ code x } values alone

public stats x stats ( ) { return x stats snapshot ( ) ; }


creates test video stream element with the given name , track type and formats

public static stream element create stream element ( string name , int track type , format formats ) { return new stream element ( test base uri , test chunk template , track type , test sub type , test timescale , name , test max width , test max height , test max width , test max height , test language , formats , / * chunk start times = * / collections empty list ( ) , / * last chunk duration = * / 0 ) ; }


determine if the specified annotation is directly present equivalent to calling { @ code get ( annotation type ) is directly present ( ) }

boolean is directly present ( string annotation type ) ;


perform url verification checks to ensure that it satisfies this connector implementation requirements

protected void check protocol ( ) throws malformed u r l exception { if ( ! ghidra u r l protocol equals ( url get protocol ( ) ) ) { throw new malformed u r l exception ( " expected ghidra url protocol " ) ; } }


public void stop ( ) { status = game status stopped ; }


public static void namespace get ( ) { return instance ; }


encodes a series of copies , each at most 64 bytes in length

private static void encode copy ( byte buf out , int offset , int length ) { while ( length > = 68 ) { encode copy with offset ( out , offset , 64 ) ; length - = 64 ; } if ( length > 64 ) { encode copy with offset ( out , offset , 60 ) ; length - = 60 ; } encode copy with offset ( out , offset , length ) ; }


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

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


public boolean get prefix boolean ( ) { return prefix boolean ; }


lists all child containers under this container a child container is defined as a container whose { @ link # path ( ) } method returns a path that has this containers { @ link # path ( ) } return as its prefix and has one more path element than the current container ' s path

map < string , blob container > children ( ) throws i o exception ;


public void set transform ( matrix new transform ) { f log v ( tag , " set transform " ) ; m active transform set ( new transform ) ; on transform changed ( ) ; }


reconcile section load range which has been determined to be in conflict with previously resolved section chunks either overlay address range or proxy address range objects will be added to range list to provide advice for subsequent memory block creation

private long reconcile section range overlap ( memory section section , address min addr , address max addr , long file offset , list < address range > range list ) { if ( section is initialized ) { object range map < allocated file section range > file load range map = get file load range map ( min addr get address space ( ) , false ) ; if ( file load range map = = null ) { / / unexpected unless memory already defined range list add ( new overlay address range ( min addr , max addr ) ) ; return file offset + max addr subtract ( min addr ) + 1 ; } long conflict range size = max addr subtract ( min addr ) + 1 ; / / conflict gap accumulator addresses address conflict gap start = null ; address conflict gap end = null ; / / note : range iterator does not fill - in the gaps , only those / / ranges which match - up will be returned , range gaps correspond / / to memory conflict index range iterator file offset range iterator = file load range map get index range iterator ( file offset , file offset + conflict range size - 1 ) ; long file pos = file offset ; address expected range start = min addr ; while ( file offset range iterator has next ( ) ) { if ( expected range start = = null ) { throw new assert exception ( " expected range start is null " ) ; } / / get file load range - which may have been loaded to a different memory area index range file offset range = file offset range iterator next ( ) ; long range size = file offset range get end ( ) - file offset range get start ( ) + 1 ; allocated file section range file range = file load range map get object ( file offset range get start ( ) ) ; if ( file offset range get start ( ) > file pos ) { / / file load gap in memory - conflict with uninitialized or pre - existing block if ( conflict gap start = = null ) { conflict gap start = expected range start ; } expected range start = expected range start add ( file offset range get start ( ) - file pos ) ; conflict gap end = expected range start previous ( ) ; } address range start addr = file range range start address add ( file pos - file range range start file offset ) ; / / ignore use of overlay and compare physical address for match to avoid duplication if ( ! expected range start get physical address ( ) equals ( range start addr get physical address ( ) ) ) { / / file load memory range does not correspond to target memory range if ( conflict gap start = = null ) { conflict gap start = expected range start ; } conflict gap end = expected range start add ( range size - 1 ) ; } else { / / file load range matches target if ( conflict gap start ! = null ) { / / add accumulated conflict gap range list add ( new overlay address range ( conflict gap start , conflict gap end ) ) ; conflict gap start = null ; conflict gap end = null ; } range list add ( new proxy address range ( expected range start , expected range start add ( range size - 1 ) ) ) ; } file pos = file offset range get end ( ) + 1 ; try { expected range start = min addr add ( file pos - file offset ) ; } catch ( address out of bounds exception e ) { / / catch case where we hit the end of the address space expected range start = null ; / / we should be done } } if ( ( file pos - file offset ) ! = conflict range size ) { / / trailing file load gap in memory - conflict with uninitialized of pre - existing block if ( conflict gap start = = null ) { conflict gap start = expected range start ; } conflict gap end = max addr ; } if ( conflict gap start ! = null ) { range list add ( new overlay address range ( conflict gap start , conflict gap end ) ) ; } return file offset + conflict range size ; } / / force proxy range condition for lower priority uninitialized section ( unlikely condition ) range list add ( new proxy address range ( min addr , max addr ) ) ; return file offset ; }


returns leaf delegation token node path based on sequence number and configured split index if the passed flag create parent if not exists is true , also creates the parent znode if it does not exist the sequence number is padded to be at least 4 digits wide to ensure consistency with the split indexing

private string get leaf delegation token node path ( int rm d t sequence number , boolean create parent if not exists ) throws exception { return get leaf delegation token node path ( rm d t sequence number , create parent if not exists , delegation token node split index ) ; }


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


make sure interceptors can interact with the ok http client asynchronously

@ test public void interceptor makes an unrelated async request ( ) throws exception { server enqueue ( new mock response ( ) set body ( " a " ) ) ; / / fetched by interceptor server enqueue ( new mock response ( ) set body ( " b " ) ) ; / / fetched directly client = client new builder ( ) add interceptor ( chain - > { if ( chain request ( ) url ( ) encoded path ( ) equals ( " / b " ) ) { request request a = new request builder ( ) url ( server url ( " / a " ) ) build ( ) ; try { recording callback callback a = new recording callback ( ) ; client new call ( request a ) enqueue ( callback a ) ; callback a await ( request a url ( ) ) assert body ( " a " ) ; } catch ( exception e ) { throw new runtime exception ( e ) ; } } return chain proceed ( chain request ( ) ) ; } ) build ( ) ; request request b = new request builder ( ) url ( server url ( " / b " ) ) build ( ) ; recording callback callback b = new recording callback ( ) ; client new call ( request b ) enqueue ( callback b ) ; callback b await ( request b url ( ) ) assert body ( " b " ) ; }


public polygon builder hole ( line string builder hole ) { return this hole ( hole , false ) ; }


public auth filter builder < c , p , t > set authorizer ( authorizer < p > authorizer ) { this authorizer = authorizer ; return this ; }


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

public static fields find by thrift id ( int field id ) { switch ( field id ) { case 1 : / / location return location ; case 2 : / / chunk return chunk ; default : return null ; } }


public com google common util concurrent listenable future < io grpc testing integration messages simple response > unary call ( io grpc testing integration messages simple request request ) { return io grpc stub client calls future unary call ( get channel ( ) new call ( get unary call method ( ) , get call options ( ) ) , request ) ; }


loads bytes in a particular format as a new { @ link domain object } multiple { @ link domain object } s may end up getting created , depending on the nature of the format

public list < domain object > load ( byte provider provider , string name , domain folder folder , load spec load spec , list < option > options , message log message log , object consumer , task monitor monitor ) throws i o exception , cancelled exception , duplicate name exception , invalid name exception , version exception ;


generates the list of overrides of methods that return { @ code request manager }

private list < method spec > generate request manager request manager method overrides ( final string generated package name ) { return fluent iterable from ( processor util find instance methods returning ( request manager type , request manager type ) ) transform ( new function < executable element , method spec > ( ) { @ override public method spec apply ( @ nullable executable element input ) { return generate request manager request manager method override ( generated package name , input ) ; } } ) to list ( ) ; }


find beans annotated with { @ link controller advice @ controller advice } in the given { @ link application context } and wrap them as { @ code controller advice bean } instances as of spring framework 5 2 , the { @ code controller advice bean } instances in the returned list are sorted using { @ link order comparator # sort ( list ) }

public static list < controller advice bean > find annotated beans ( application context context ) { listable bean factory bean factory = context ; if ( context instanceof configurable application context ) { / / use internal bean factory for potential downcast to configurable bean factory above bean factory = ( ( configurable application context ) context ) get bean factory ( ) ; } list < controller advice bean > advice beans = new array list < > ( ) ; for ( string name : bean factory utils bean names for type including ancestors ( bean factory , object class ) ) { if ( ! scoped proxy utils is scoped target ( name ) ) { controller advice controller advice = bean factory find annotation on bean ( name , controller advice class ) ; if ( controller advice ! = null ) { / / use the @ controller advice annotation found by find annotation on bean ( ) / / in order to avoid a subsequent lookup of the same annotation advice beans add ( new controller advice bean ( name , bean factory , controller advice ) ) ; } } } order comparator sort ( advice beans ) ; return advice beans ; }


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


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

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


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


test { @ link bloom map file reader } constructor with i o exception

public void test i o exception in writer constructor ( ) { path dir name spy = spy ( test file ) ; bloom map file reader reader = null ; bloom map file writer writer = null ; try { writer = new bloom map file writer ( conf , test file , map file writer key class ( int writable class ) , map file writer value class ( text class ) ) ; writer append ( new int writable ( 1 ) , new text ( " 123124142 " ) ) ; writer close ( ) ; when ( dir name spy get file system ( conf ) ) then throw ( new i o exception ( ) ) ; reader = new bloom map file reader ( dir name spy , conf , map file reader comparator ( new writable comparator ( int writable class ) ) ) ; assert null ( " test i o exception in writer constructor error ! ! ! " , reader get bloom filter ( ) ) ; } catch ( exception ex ) { fail ( " unexpect ex in test i o exception in writer constructor ! ! ! " ) ; } finally { i o utils cleanup with logger ( log , writer , reader ) ; } }


enter a parse tree produced by { @ link sql base parser # set quantifier }

void enter set quantifier ( sql base parser set quantifier context ctx ) ;


performs one - time initialization of the metadata store via configuration this initialization depends on the configuration object to get aws credentials , dynamo d b factory implementation class , dynamo d b endpoints , dynamo d b table names etc after initialization , this metadata store does not explicitly relate to any s3 bucket , which be nonexistent this is used to operate the metadata store directly beyond the scope of the s 3 a file system integration , e g command line tools generally , callers should use { @ link metadata store # initialize ( file system , i ttl time provider ) } with an initialized { @ code s 3 a file system } instance without a filesystem to act as a reference point , the configuration itself must declare the table name and region in the { @ link constants # s3guard ddb table name key } and { @ link constants # s3guard ddb region key } respectively it also creates a new credential provider list from the configuration , using the base fs s 3a options , as there is no bucket to infer per - bucket settings from

public void initialize ( configuration config , i ttl time provider ttl tp ) throws i o exception { conf = config ; / / use the bucket as the dynamo d b table name if not specified in config table name = conf get trimmed ( s3guard ddb table name key ) ; preconditions check argument ( ! string utils is empty ( table name ) , " no dynamo d b table name configured " ) ; region = conf get trimmed ( s3guard ddb region key ) ; preconditions check argument ( ! string utils is empty ( region ) , " no dynamo d b region configured " ) ; / / there ' s no uri here , which complicates life : you cannot / / create aws providers here which require one credentials = create a w s credential provider set ( null , conf ) ; dynamo d b = create dynamo d b ( conf , region , null , credentials ) ; username = user group information get current user ( ) get short user name ( ) ; / / without an executor from the owner fs , create one using / / the executor capacity for work int executor capacity = int option ( conf , executor capacity , default executor capacity , 1 ) ; executor = blocking thread pool executor service new instance ( executor capacity , executor capacity * 2 , long option ( conf , keepalive time , default keepalive time , 0 ) , time unit seconds , " s 3a - ddb - " + table name ) ; init data access retries ( conf ) ; this ttl time provider = ttl tp ; table handler = new dynamo d b metadata store table manager ( dynamo d b , table name , region , amazon dynamo d b , conf , read op , batch write retry policy ) ; this table = table handler init table ( ) ; }


an implementation of { @ link multiset # remove all }

static boolean remove all impl ( multiset < ? > self , collection < ? > elements to remove ) { collection < ? > collection = ( elements to remove instanceof multiset ) ? ( ( multiset < ? > ) elements to remove ) element set ( ) : elements to remove ; return self element set ( ) remove all ( collection ) ; }


public void test client back off ( ) throws exception { server server ; final test rpc service proxy ; boolean succeeded = false ; final int num clients = 2 ; final list < future < void > > res = new array list < future < void > > ( ) ; final executor service executor service = executors new fixed thread pool ( num clients ) ; conf set int ( common configuration keys ipc client connect max retries key , 0 ) ; conf set boolean ( common configuration keys ipc namespace + " 0 " + common configuration keys ipc backoff enable , true ) ; rpc builder builder = new server builder ( conf ) set queue size per handler ( 1 ) set num handlers ( 1 ) set verbose ( true ) ; server = setup test server ( builder ) ; @ suppress warnings ( " unchecked " ) call queue manager < call > spy = spy ( ( call queue manager < call > ) whitebox get internal state ( server , " call queue " ) ) ; whitebox set internal state ( server , " call queue " , spy ) ; exception last exception = null ; proxy = get client ( addr , conf ) ; try { / / start a sleep rpc call to consume the only handler thread / / start another sleep rpc call to make call queue full / / start another sleep rpc call to make reader thread block on call queue for ( int i = 0 ; i < num clients ; i + + ) { res add ( executor service submit ( new callable < void > ( ) { @ override public void call ( ) throws service exception , interrupted exception { proxy sleep ( null , new sleep request ( 100000 ) ) ; return null ; } } ) ) ; verify ( spy , timeout ( 500 ) times ( i + 1 ) ) add internal ( any ( ) , eq ( false ) ) ; } try { proxy sleep ( null , new sleep request ( 100 ) ) ; } catch ( service exception e ) { remote exception re = ( remote exception ) e get cause ( ) ; i o exception unwrap exeption = re unwrap remote exception ( ) ; if ( unwrap exeption instanceof retriable exception ) { succeeded = true ; } else { last exception = unwrap exeption ; } } } finally { executor service shutdown ( ) ; stop ( server , proxy ) ; } if ( last exception ! = null ) { log error ( " last received non - retriable exception : " , last exception ) ; } assert true ( " retriable exception not received " , succeeded ) ; }


specify a prefix that can be used for parameters that indicate default value fields , having " prefix + field " as name the value of the default field is used when the field is not provided default is " ! " , for " ! field " parameters ( e g " ! subscribe to newsletter " ) set this to null if you want to turn off the field defaults completely html checkboxes only send a value when they ' re checked , so it is not possible to detect that a formerly checked box has just been unchecked , at least not with standard html means a default field is especially useful when a checkbox represents a non - boolean value the presence of a default parameter preempts the behavior of a field marker for the given field

public void set field default prefix ( @ nullable string field default prefix ) { this field default prefix = field default prefix ; }


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

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


let the build complete , and see if stateless { @ link console annotator } annotations happen as expected

@ test public void completed stateless log annotation ( ) throws exception { free style project p = r create free style project ( ) ; p get builders list ( ) add ( new test builder ( ) { public boolean perform ( abstract build < ? , ? > build , launcher launcher , build listener listener ) throws interrupted exception , i o exception { listener get logger ( ) println ( " - - - " ) ; listener get logger ( ) println ( " ooo " ) ; listener get logger ( ) println ( " ooo " ) ; return true ; } } ) ; free style build b = r build and assert success ( p ) ; / / make sure we see the annotation html page rsp = r create web client ( ) get page ( b , " console " ) ; assert equals ( 1 , dom node util select nodes ( rsp , " / / b [ @ class = ' demo ' ] " ) size ( ) ) ; / / make sure raw console output doesn ' t include the garbage text page raw = ( text page ) r create web client ( ) go to ( b get url ( ) + " console text " , " text / plain " ) ; system out println ( raw get content ( ) ) ; string nl = system get property ( " line separator " ) ; assert true ( raw get content ( ) contains ( nl + " - - - " + nl + " ooo " + nl + " ooo " + nl ) ) ; / / there should be two ' ooo ' s string xml = rsp as xml ( ) ; assert equals ( xml , 3 , xml split ( " ooo " ) length ) ; }


indicates whatever is possible to start the mission

public boolean is corrupt ( ) { if ( urls length < 1 ) return false ; return ( is ps failed ( ) | | err code = = error postprocessing hold ) | | is finished ( ) ; }


get the list of all themes ( native + bundled )

public static vector < m t theme facade > get all themes ( ) { / / final vector < m t theme facade > mt theme facades = new vector < > ( themes map values ( ) ) ; / / mt theme facades sort ( comparator comparing int ( m t theme facade : : get order ) ) ; return themes map values ( ) stream ( ) filter ( mt theme facade - > ! mt theme facade is premium ( ) ) sorted ( comparator comparing int ( m t theme facade : : get order ) ) collect ( collectors to collection ( vector : : new ) ) ; }


this test validates the correctness of { @ link router web service util # merge metrics }

public void test merge metrics ( ) { cluster metrics info metrics = new cluster metrics info ( ) ; cluster metrics info metrics response = new cluster metrics info ( ) ; long seed = system current time millis ( ) ; set up cluster metrics ( metrics , seed ) ; / / ensure that we don ' t reuse the same seed when setting up metrics response / / or it might mask bugs seed + = 1000000000 ; set up cluster metrics ( metrics response , seed ) ; cluster metrics info metrics clone = create cluster metrics clone ( metrics ) ; router web service util merge metrics ( metrics , metrics response ) ; assert assert equals ( metrics response get apps submitted ( ) + metrics clone get apps submitted ( ) , metrics get apps submitted ( ) ) ; assert assert equals ( metrics response get apps completed ( ) + metrics clone get apps completed ( ) , metrics get apps completed ( ) ) ; assert assert equals ( metrics response get apps pending ( ) + metrics clone get apps pending ( ) , metrics get apps pending ( ) ) ; assert assert equals ( metrics response get apps running ( ) + metrics clone get apps running ( ) , metrics get apps running ( ) ) ; assert assert equals ( metrics response get apps failed ( ) + metrics clone get apps failed ( ) , metrics get apps failed ( ) ) ; assert assert equals ( metrics response get apps killed ( ) + metrics clone get apps killed ( ) , metrics get apps killed ( ) ) ; assert assert equals ( metrics response get reserved m b ( ) + metrics clone get reserved m b ( ) , metrics get reserved m b ( ) ) ; assert assert equals ( metrics response get available m b ( ) + metrics clone get available m b ( ) , metrics get available m b ( ) ) ; assert assert equals ( metrics response get allocated m b ( ) + metrics clone get allocated m b ( ) , metrics get allocated m b ( ) ) ; assert assert equals ( metrics response get reserved virtual cores ( ) + metrics clone get reserved virtual cores ( ) , metrics get reserved virtual cores ( ) ) ; assert assert equals ( metrics response get available virtual cores ( ) + metrics clone get available virtual cores ( ) , metrics get available virtual cores ( ) ) ; assert assert equals ( metrics response get allocated virtual cores ( ) + metrics clone get allocated virtual cores ( ) , metrics get allocated virtual cores ( ) ) ; assert assert equals ( metrics response get containers allocated ( ) + metrics clone get containers allocated ( ) , metrics get containers allocated ( ) ) ; assert assert equals ( metrics response get reserved containers ( ) + metrics clone get reserved containers ( ) , metrics get reserved containers ( ) ) ; assert assert equals ( metrics response get pending containers ( ) + metrics clone get pending containers ( ) , metrics get pending containers ( ) ) ; assert assert equals ( metrics response get total m b ( ) + metrics clone get total m b ( ) , metrics get total m b ( ) ) ; assert assert equals ( metrics response get total virtual cores ( ) + metrics clone get total virtual cores ( ) , metrics get total virtual cores ( ) ) ; assert assert equals ( metrics response get total nodes ( ) + metrics clone get total nodes ( ) , metrics get total nodes ( ) ) ; assert assert equals ( metrics response get lost nodes ( ) + metrics clone get lost nodes ( ) , metrics get lost nodes ( ) ) ; assert assert equals ( metrics response get unhealthy nodes ( ) + metrics clone get unhealthy nodes ( ) , metrics get unhealthy nodes ( ) ) ; assert assert equals ( metrics response get decommissioning nodes ( ) + metrics clone get decommissioning nodes ( ) , metrics get decommissioning nodes ( ) ) ; assert assert equals ( metrics response get decommissioned nodes ( ) + metrics clone get decommissioned nodes ( ) , metrics get decommissioned nodes ( ) ) ; assert assert equals ( metrics response get rebooted nodes ( ) + metrics clone get rebooted nodes ( ) , metrics get rebooted nodes ( ) ) ; assert assert equals ( metrics response get active nodes ( ) + metrics clone get active nodes ( ) , metrics get active nodes ( ) ) ; assert assert equals ( metrics response get shutdown nodes ( ) + metrics clone get shutdown nodes ( ) , metrics get shutdown nodes ( ) ) ; }


test that a particular cell value evaluates to some object

public void evaluates to ( t expected , string input ) { cell cell = new cell ( input , null ) ; evaluates to ( expected , cell ) ; }


gets a field object for the given index this method is called for the given index and the field offset that is defined in the constructor

public field get field ( big integer index ) { if ( index map = = null ) { return null ; } / / translate index to block and offset into the block byte block info info = index map get block info ( index , field offset ) ; if ( info = = null ) { if ( index map show separator ( index ) ) { byte field bf = new byte field ( no value str , fm , start x , width , false , field offset , index , highlight factory ) ; bf set foreground ( separator color ) ; return bf ; } return null ; } try { byte block block = info get block ( ) ; big integer offset = info get offset ( ) ; if ( ! block has value ( offset ) ) { / / if the byte block doesn ' t have initialized values at the offset , don ' t try to read / / as it causes visual slowness when exceptions are thrown and caught / / the following line is the same as the catch ( byte block access exception ) handler return get byte field ( read error str , index ) ; } string str = model get data representation ( block , offset ) ; byte field bf = new byte field ( str , fm , start x , width , false , field offset , index , highlight factory ) ; if ( block set is changed ( block , offset , unit byte size ) ) { bf set foreground ( edit color ) ; } return bf ; } catch ( byte block access exception e ) { / / usually caused by un initialized memory block return get byte field ( read error str , index ) ; } catch ( address out of bounds exception e ) { return get byte field ( no value str , index ) ; } catch ( index out of bounds exception e ) { return get byte field ( no value str , index ) ; } }


returns a stream for reading this file as bytes @ throw gdx runtime exception if the file handle represents a directory , doesn ' t exist , or could not be read

public input stream read ( ) { if ( type = = file type classpath | | ( type = = file type internal & & ! file exists ( ) ) | | ( type = = file type local & & ! file exists ( ) ) ) { input stream input = file wrapper class get resource as stream ( " / " + file get path ( ) replace ( ' \ \ ' , ' / ' ) ) ; if ( input = = null ) throw new gdx runtime exception ( " file not found : " + file + " ( " + type + " ) " ) ; return input ; } try { return new file input stream ( file ( ) ) ; } catch ( exception ex ) { if ( file ( ) is directory ( ) ) throw new gdx runtime exception ( " cannot open a stream to a directory : " + file + " ( " + type + " ) " , ex ) ; throw new gdx runtime exception ( " error reading file : " + file + " ( " + type + " ) " , ex ) ; } }


loads and returns a stream of the names of all available executors

stream < string > get executor names ( ) ;


downsampling the metrics to day precision


returns a view of this range map as an unmodifiable { @ code map < range < k > , v > } modifications to this range map are guaranteed to read through to the returned { @ code map } the returned { @ code map } iterates over entries in ascending order of the bounds of the { @ code range } entries it is guaranteed that no empty ranges will be in the returned { @ code map }

map < range < k > , v > as map of ranges ( ) ;


convert the given request object to serialized form , possibly using a { @ link org springframework messaging converter message converter } , send it as a { @ link message } to the given destination , receive the reply and convert its body of the specified target class

< t > t convert send and receive ( d destination , object request , class < t > target class ) throws messaging exception ;


get all the stack variables in the negative portion of the stack this excludes any variables defined before the parameter offset if the parameter offset is negative

private variable [ ] get negative variables ( ) { if ( variables is empty ( ) ) { return empty array ; } int length = variables size ( ) ; / / find the end of the negatives int index = 0 ; for ( index = 0 ; index < length ; index + + ) { variable var = variables get ( index ) ; int stack offset = var get stack offset ( ) ; int start = stack offset ; if ( start > = 0 | | start > param start ) { break ; } } if ( index = = 0 ) { return empty array ; } / / return the variables in the order of - 1 to - n list < variable > vars = variables sub list ( 0 , index ) ; int size = vars size ( ) ; variable [ ] retvars = new variable [ size ] ; int pos = size - 1 ; for ( int i = 0 ; i < size ; i + + , pos - - ) { retvars [ pos ] = vars get ( i ) ; } return retvars ; }


deprecated use ` fill get gradient colors ( ) `

public int get start color ( ) { return get gradient colors ( ) [ 0 ] ; }


public static double read double ( byte [ ] bytes , int start ) { return writable comparator read double ( bytes , start ) ; }


called from the dialog when the " cancel " button is hit ; call the current merge resolver ' s cancel ( ) method , and wake up the merge thread waiting on user input

synchronized void cancel ( ) { is cancelled = true ; run manager cancel all runnables ( ) ; if ( current index < merge resolvers length ) { merge resolvers [ current index ] cancel ( ) ; } notify ( ) ; }


return the configured send timeout ( in milliseconds )

public long get send timeout ( ) { return this send timeout ; }


public static string generate g u i d ( boolean secure ) { string local host addr ; { java net inet address id ; try { id = java net inet address get local host ( ) ; local host addr = id to string ( ) ; } catch ( java net unknown host exception e ) { local host addr = " localhost " ; } } long time = system current time millis ( ) ; long rand ; if ( secure ) { rand = secure rand next long ( ) ; } else { rand = security utils random next long ( ) ; } / / this string builder can be a long as you need ; the md5 / / hash will always return 128 bits you can change / / the seed to include anything you want here / / you could even stream a file through the md5 making / / the odds of guessing it at least as great as that / / of guessing the contents of the file ! string builder sb = new string builder ( 32 ) ; sb append ( local host addr ) append ( " : " ) append ( long to string ( time ) ) append ( " : " ) append ( long to string ( rand ) ) ; byte [ ] array ; try { message digest md 5 = message digest get instance ( ecryption algorythm ) ; md 5 update ( sb to string ( ) get bytes ( ) ) ; array = md 5 digest ( ) ; } catch ( no such algorithm exception e ) { / / too bad lets get simple random numbers array = new byte [ 16 ] ; random next bytes ( array ) ; } sb set length ( 0 ) ; for ( int j = 0 ; j < array length ; + + j ) { int b = array [ j ] & 0x f f ; if ( b < 0x 1 0 ) { sb append ( ' 0 ' ) ; } sb append ( integer to hex string ( b ) ) ; } string raw = sb to string ( ) to upper case ( ) ; sb set length ( 0 ) ; sb append ( raw substring ( 0 , 8 ) ) ; sb append ( " - " ) ; sb append ( raw substring ( 8 , 12 ) ) ; sb append ( " - " ) ; sb append ( raw substring ( 12 , 16 ) ) ; sb append ( " - " ) ; sb append ( raw substring ( 16 , 20 ) ) ; sb append ( " - " ) ; sb append ( raw substring ( 20 ) ) ; return sb to string ( ) ; }


get the schema of the model rows that are passed to { @ link # load model ( list ) }

protected table schema get model schema ( ) { return table schema builder ( ) fields ( this model field names , this model field types ) build ( ) ; }


returns true if the scm polling thread queue has too many jobs than it can handle

public boolean is clogged ( ) { return queue is starving ( starvation threshold ) ; }


gets the component id for the specified task id the component id maps to a component id specified for a spout or bolt in the topology definition

public string get component id ( int task id ) { if ( task id = = constants system task id ) { return constants system component id ; } else { return task to component get ( task id ) ; } }


verifies a { @ code - filelist } file ' s contents

protected void verify objlist ( action original action , string input archives ) throws exception { immutable list builder < string > exec paths = immutable list builder ( ) ; for ( string input archive : input archives ) { exec paths add ( exec path ending with ( original action get inputs ( ) to list ( ) , input archive ) ) ; } assert that ( param file args for action ( original action ) ) contains exactly elements in ( exec paths build ( ) ) ; }


notify all the handshake futures about the failure during the handshake

private void set handshake failure ( channel handler context ctx , throwable cause , boolean close inbound , boolean notify , boolean always flush and close ) { try { / / release all resources such as internal buffers that s s l engine / / is managing outbound closed = true ; engine close outbound ( ) ; if ( close inbound ) { try { engine close inbound ( ) ; } catch ( s s l exception e ) { if ( logger is debug enabled ( ) ) { / / only log in debug mode as it most likely harmless and latest chrome still trigger / / this all the time / / / / see https : / / github com / netty / netty / issues / 1340 string msg = e get message ( ) ; if ( msg = = null | | ! ( msg contains ( " possible truncation attack " ) | | msg contains ( " closing inbound before receiving peer ' s close notify " ) ) ) { logger debug ( " { } s s l engine close inbound ( ) raised an exception " , ctx channel ( ) , e ) ; } } } } if ( handshake promise try failure ( cause ) | | always flush and close ) { ssl utils handle handshake failure ( ctx , cause , notify ) ; } } finally { / / ensure we remove and fail all pending writes in all cases and so release memory quickly release and fail all ( ctx , cause ) ; } }


public string get capital camel ( ) { return capital camel ; }


private string pad ( string value ) { string buffer sb = new string buffer ( ) ; int len = symbol size - value length ( ) ; for ( int i = 0 ; i < len ; i + + ) { sb append ( " 0 " ) ; } sb append ( value ) ; return sb to string ( ) ; }


get a composite object wrapping the instances of the { @ link state store } with the provided store name and { @ link queryable store type }

public < t > t get store ( final store query parameters < t > store query parameters ) { final string store name = store query parameters store name ( ) ; final queryable store type < t > queryable store type = store query parameters queryable store type ( ) ; final list < t > global store = global store provider stores ( store name , queryable store type ) ; if ( ! global store is empty ( ) ) { return queryable store type create ( global store provider , store name ) ; } return queryable store type create ( new wrapping store provider ( store providers , store query parameters ) , store name ) ; }


returns an unmodifiable view of the specified { @ code list multimap } query operations on the returned multimap " read through " to the specified multimap , and attempts to modify the returned multimap , either directly or through the multimap ' s views , result in an { @ code unsupported operation exception } the returned multimap will be serializable if the specified multimap is serializable

public static < k , v > list multimap < k , v > unmodifiable list multimap ( list multimap < k , v > delegate ) { if ( delegate instanceof unmodifiable list multimap | | delegate instanceof immutable list multimap ) { return delegate ; } return new unmodifiable list multimap < > ( delegate ) ; }


returns the minimum of the two values , according to the given comparator if the values compare as equal , the first is returned the recommended solution for finding the { @ code minimum } of some values depends on the type of your data and the number of elements you have read more in the guava user guide article on < a href = " https : github comgoogleguavawiki collection utilities explained # comparators " > { @ code comparators }

public static < t > t min ( @ nullable decl t a , @ nullable decl t b , comparator < t > comparator ) { return ( comparator compare ( a , b ) < = 0 ) ? a : b ; }


public void next key ( ) throws i o exception { / / read until we find a new key while ( has next ) { read next key ( ) ; } + + ctr ; / / move the next key to the current one key tmp key = key ; key = next key ; next key = tmp key ; has next = more ; }


public list < localization status > get localization statuses ( ) { list < localization status > statuses = new array list < > ( ) ; localized resources for each ( ( key , path ) - > { localization status status = localization status new instance ( key , localization state completed ) ; statuses add ( status ) ; } ) ; pending resources for each ( ( lr req , keys ) - > keys for each ( key - > { localization status status = localization status new instance ( key , localization state pending ) ; statuses add ( status ) ; } ) ) ; synchronized ( resources failed to be localized ) { statuses add all ( resources failed to be localized ) ; } return statuses ; }


try to call { @ link reference counted # release ( int ) } if the specified message implements { @ link reference counted } if the specified message doesn ' t implement { @ link reference counted } , this method does nothing

public static boolean release ( object msg , int decrement ) { if ( msg instanceof reference counted ) { return ( ( reference counted ) msg ) release ( decrement ) ; } return false ; }


no longer used this method is now a no - op but the signature is retained for backward compatibility

public string legacy filename of ( @ non null string id ) { return null ; }


tests the deferred cleanup of { @ link permanent blob cache } , i e after calling { @ link permanent blob cache # release job ( job i d ) } the file should be preserved a bit longer and then cleaned up

public void test permanent blob deferred cleanup ( ) throws i o exception , interrupted exception { / / file should be deleted between 5 and 1 0s after last job release long cleanup interval = 5l ; job i d job id = new job i d ( ) ; list < permanent blob key > keys = new array list < > ( ) ; blob server server = null ; permanent blob cache cache = null ; final byte [ ] buf = new byte [ 128 ] ; try { configuration config = new configuration ( ) ; config set string ( blob server options storage directory , temporary folder new folder ( ) get absolute path ( ) ) ; config set long ( blob server options cleanup interval , cleanup interval ) ; server = new blob server ( config , new void blob store ( ) ) ; server start ( ) ; inet socket address server address = new inet socket address ( " localhost " , server get port ( ) ) ; cache = new permanent blob cache ( config , new void blob store ( ) , server address ) ; / / upload blobs keys add ( server put permanent ( job id , buf ) ) ; buf [ 0 ] + = 1 ; keys add ( server put permanent ( job id , buf ) ) ; check file count for job ( 2 , job id , server ) ; check file count for job ( 0 , job id , cache ) ; / / register once cache register job ( job id ) ; check file count for job ( 2 , job id , server ) ; check file count for job ( 0 , job id , cache ) ; for ( permanent blob key key : keys ) { cache get file ( job id , key ) ; } / / register again ( let ' s say , from another thread or so ) cache register job ( job id ) ; for ( permanent blob key key : keys ) { cache get file ( job id , key ) ; } assert equals ( 2 , check files exist ( job id , keys , cache , true ) ) ; check file count for job ( 2 , job id , server ) ; check file count for job ( 2 , job id , cache ) ; / / after releasing once , nothing should change cache release job ( job id ) ; assert equals ( 2 , check files exist ( job id , keys , cache , true ) ) ; check file count for job ( 2 , job id , server ) ; check file count for job ( 2 , job id , cache ) ; / / after releasing the second time , the job is up for deferred cleanup cache release job ( job id ) ; / / files should still be accessible for now assert equals ( 2 , check files exist ( job id , keys , cache , true ) ) ; check file count for job ( 2 , job id , cache ) ; thread sleep ( cleanup interval / 5 ) ; / / still accessible assert equals ( 2 , check files exist ( job id , keys , cache , true ) ) ; check file count for job ( 2 , job id , cache ) ; thread sleep ( ( cleanup interval * 4 ) / 5 ) ; / / files are up for cleanup now wait for it : verify job cleanup ( cache , job id , keys ) ; / / server should be unaffected check file count for job ( 2 , job id , server ) ; } finally { if ( cache ! = null ) { cache close ( ) ; } if ( server ! = null ) { server close ( ) ; } / / now everything should be cleaned up check file count for job ( 0 , job id , server ) ; } }


is the system in startup safe mode , i e the system is starting up with safe mode turned on automatically ?

public boolean is in startup safe mode ( ) ;


override this to perform actions after the call to { @ code actual on subscribe ( this ) } happened

protected void after downstream ( ) { / / default no - op }


sets a predicate for dynamically determining if this action should be included in an impending pop - up menu if this predicate is not set , the action ' s will be included in an impending pop - up , if it is enabled see { @ link docking action if # is add to popup ( action context ) }

public void popup when ( predicate < action context > predicate ) { popup predicate = predicate ; }


< code > optional string msg = 1 ; < code >

public com google protobuf byte string get msg bytes ( ) { java lang object ref = msg ; if ( ref instanceof string ) { com google protobuf byte string b = com google protobuf byte string copy from utf 8 ( ( java lang string ) ref ) ; msg = b ; return b ; } else { return ( com google protobuf byte string ) ref ; } }


private void create panel ( ) { get content pane ( ) set layout ( new flow layout ( flow layout left , 0 , 0 ) ) ; j panel outer panel = new j panel ( ) ; outer panel set layout ( new flow layout ( flow layout left , 0 , 0 ) ) ; j panel options panel = new j panel ( ) ; options panel set layout ( new pair layout ( ) ) ; / / delimiter row j label delimiter character field name = new g label ( " delimiter : " ) ; delimiter character field name set tool tip text ( " set the character used to separate filter terms " ) ; delimiter character c b = new g combo box < > ( filter options valid multiterm delimiters array ) ; delimiter character c b set renderer ( new delimiter list cell renderer ( ) ) ; j panel fixed size panel = new j panel ( ) ; fixed size panel set layout ( new flow layout ( flow layout left ) ) ; fixed size panel add ( delimiter character c b ) ; options panel add ( delimiter character field name ) ; options panel add ( fixed size panel ) ; / / mode row j label label = new g label ( " evaluation mode : " ) ; j panel button group panel = new j panel ( ) ; button group panel set layout ( new flow layout ( flow layout left ) ) ; button group mode btn group = new button group ( ) ; multiterm evaluation mode [ ] modes = multiterm evaluation mode values ( ) ; for ( multiterm evaluation mode mode : modes ) { g radio button mode r b = new g radio button ( mode name ( ) ) ; mode r b set tool tip text ( mode get description ( ) ) ; mode r b add action listener ( e - > { eval mode = multiterm evaluation mode value of ( mode name ( ) ) ; } ) ; mode buttons add ( mode r b ) ; mode btn group add ( mode r b ) ; button group panel add ( mode r b ) ; } options panel add ( label ) ; options panel add ( button group panel ) ; options panel set border ( new empty border ( 0 , 22 , 0 , 0 ) ) ; outer panel add ( options panel ) ; add ( outer panel ) ; options pane disable layer = disabled component layer factory get disabled layer ( outer panel ) ; add ( options pane disable layer ) ; }


returns the value of the array at the given index , assuming this type is an integer array

public integer value integer array load ( integer value index value , value factory value factory ) { return value factory create integer value ( ) ; }


gets the display width of the component field at the specified column index

public int get field width ( int column index ) { return ( ( column index < 0 | | column index > = get column count ( ) ) ? 0 : column widths [ column index ] ) ; }


public string to string ( ) { return string format ( " % s count = % d total = % 3fs mean = % 3fs stddev = % 3fs min = % 3fs max = % 3fs " , operation , count , to seconds ( sum ) , to seconds ( mean ) , get deviation ( ) / one ns , to seconds ( min ) , to seconds ( max ) ) ; }


returns the number of media sources in the playlist

public synchronized int get size ( ) { return media sources public size ( ) ; }


returns the record number ( id ) that indicates the type of primitive type

public int get number ( ) { return rec num ; }


set the { @ code tcp notsent lowat } option on the socket see { @ code man 7 tcp } for more details

public epoll socket channel config set tcp not sent low at ( long tcp not sent low at ) { try { ( ( epoll socket channel ) channel ) socket set tcp not sent low at ( tcp not sent low at ) ; return this ; } catch ( i o exception e ) { throw new channel exception ( e ) ; } }


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

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


sets the output apk instead of creating with a staticstandard path

public apk actions builder set artifact location directory ( string artifact location ) { this artifact location = artifact location ; return this ; }