get the aggregated utilization of the containers in this node

private resource utilization get containers utilization ( ) { containers monitor containers monitor = this context get container manager ( ) get containers monitor ( ) ; return containers monitor get containers utilization ( ) ; }


the scope of self namespace is to an application itself , the application id can be delay binding to the namespace

public void set application id ( application id app id ) { this application id = app id ; }


public final string get task cmd ( ) { return task cmd ; }


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

public string get dummy ( ) { return dummy ; }


returns the type value of the { @ link file system info } annotation attached to the specified class

public static string get filesystem type from class ( class < ? > clazz ) { file system info fsi = clazz get annotation ( file system info class ) ; return fsi ! = null ? fsi type ( ) : null ; }


public void test try parse number ( ) { assert equals ( " successful parse did not return the parsed value " , 20 , util try parse number ( " 20 " , 10 ) int value ( ) ) ; assert equals ( " failed parse did not return the default value " , 10 , util try parse number ( " ss " , 10 ) int value ( ) ) ; assert equals ( " parsing empty string did not return the default value " , 10 , util try parse number ( " " , 10 ) int value ( ) ) ; assert equals ( " parsing null string did not return the default value " , 10 , util try parse number ( null , 10 ) int value ( ) ) ; }


launches another default tool , not overwriting this env ' s current tool

public plugin tool launch another default tool ( ) { plugin tool new tool = create default tool ( ) ; abstract generic test run swing ( ( ) - > new tool set tool name ( new tool get tool name ( ) + tool i d + + ) ) ; extra tools add ( new tool ) ; return new tool ; }


sets this source to bounded ( batch ) mode in this mode , the source processes the files that are under the given paths when the application is started once all files are processed , the source will finish this setting is also the default behavior this method is mainly here to " switch back " to bounded ( batch ) mode , or to make it explicit in the source construction

public self process static file set ( ) { this continuous source settings = null ; return self ( ) ; }


declare that create operator will not be called any more and release any resources associated with this factory this method will be called only once implementation doesn ' t need to worry about duplicate invocations it is guaranteed that this will only be invoked after { @ link # no more operators ( lifespan ) } has been invoked for all applicable driver groups


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


evaluate the next { @ link statement statement } in the execution chain ( typically an instance of { @ link spring repeat } ) and throw a { @ link timeout exception } if the next { @ code statement } executes longer than the specified { @ code timeout }

public void evaluate ( ) throws throwable { if ( this timeout = = 0 ) { this next evaluate ( ) ; } else { long start time = system current time millis ( ) ; this next evaluate ( ) ; long elapsed = system current time millis ( ) - start time ; if ( elapsed > this timeout ) { throw new timeout exception ( string format ( " test took % s ms ; limit was % s ms " , elapsed , this timeout ) ) ; } } }


public generic drawee hierarchy builder set retry image ( int resource id ) { m retry image = m resources get drawable ( resource id ) ; return this ; }


the version of the node this token was created on

version get version ( ) { return version ; }


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


returns { @ link method } instances for the tests that assume that the inverse will be the same after serialization

public static list < method > get inverse same after serializing methods ( ) { return collections singleton list ( get method ( " test inverse serialization " ) ) ; }


clear the current status - same as set status text ( " " ) without being recorded


returns an { @ code output stream } that encodes bytes using this encoding into the specified { @ code writer } when the returned { @ code output stream } is closed , so is the backing { @ code writer }

public abstract output stream encoding stream ( writer writer ) ;


test whether converting a collection of users to dto users and then converting them back to domain users returns an equal collection

public void test collection conversion ( ) { var users = list of ( new user ( " camile " , " tough " , false , " 1 2 4sad " ) , new user ( " marti " , " luther " , true , " 4 2 3 0 9fd " ) , new user ( " kate " , " smith " , true , " if 0 2 4 3 " ) ) ; var from dtos = user converter create from dtos ( user converter create from entities ( users ) ) ; assert equals ( users , from dtos ) ; }


verify the ability to limit the number of concurrent connections

public void test max cnxns ( ) throws i o exception , interrupted exception { string [ ] split = host port split ( " : " ) ; host = split [ 0 ] ; port = integer parse int ( split [ 1 ] ) ; int num threads = num cnxns + 5 ; cnxn thread [ ] threads = new cnxn thread [ num threads ] ; for ( int i = 0 ; i < num cnxns ; + + i ) { threads [ i ] = new cnxn thread ( i ) ; } for ( int i = 0 ; i < num cnxns ; + + i ) { threads [ i ] start ( ) ; } for ( int i = 0 ; i < num cnxns ; + + i ) { threads [ i ] join ( ) ; } assert same ( num cnxns , num connected get ( ) ) ; }


boolean is show quotaby type ( ) { return show quotaby type ; }


returns the case - insensitive hash code of the specified string note that this method uses the same hashing algorithm with { @ link # hash code ( ) } so that you can put both { @ link ascii string } s and arbitrary { @ link char sequence } s into the same headers

public static int hash code ( char sequence value ) { if ( value = = null ) { return 0 ; } if ( value instanceof ascii string ) { return value hash code ( ) ; } return platform dependent hash code ascii ( value ) ; }


whether request processing is in asynchronous mode meaning that the response will not be committed after the current thread is exited

protected boolean is async started ( http servlet request request ) { return web async utils get async manager ( request ) is concurrent handling started ( ) ; }


returns time when this plan started executing

public long get start time ( ) { return 0 ; }


cleanup meta folder and other temporary files

private void cleanup ( configuration conf ) { path meta folder = new path ( conf get ( dist cp constants conf label meta folder ) ) ; try { file system fs = meta folder get file system ( conf ) ; log info ( " cleaning up temporary work folder : " + meta folder ) ; fs delete ( meta folder , true ) ; } catch ( i o exception ignore ) { log error ( " exception encountered " , ignore ) ; } }


public string get last name ( ) { return last name ; }


marks the given visitor accepter as possibly being used

protected void mark as possibly used ( visitor accepter visitor accepter ) { visitor accepter set visitor info ( possibly used ) ; }


public static stats trace context new client context ( final call options call options , final attributes transport attrs , metadata headers ) { list < client stream tracer factory > factories = call options get stream tracer factories ( ) ; if ( factories is empty ( ) ) { return noop ; } client stream tracer stream info info = client stream tracer stream info new builder ( ) set transport attrs ( transport attrs ) set call options ( call options ) build ( ) ; / / this array will be iterated multiple times per rpc use primitive array instead of collection / / so that for - each doesn ' t create an iterator every time stream tracer [ ] tracers = new stream tracer [ factories size ( ) ] ; for ( int i = 0 ; i < tracers length ; i + + ) { tracers [ i ] = factories get ( i ) new client stream tracer ( info , headers ) ; } return new stats trace context ( tracers ) ; }


get the constructor being called this method is a friendly implementation of the { @ link joinpoint # get static part ( ) } method ( same result )


verify that the current directory exists and that the previous directory does not exist verify that current hasn ' t been modified by comparing the checksum of all it ' s containing files with their original checksum

static void check result ( string [ ] name node dirs , string [ ] data node dirs , string bpid ) throws exception { list < file > dirs = lists new array list ( ) ; for ( int i = 0 ; i < name node dirs length ; i + + ) { file cur dir = new file ( name node dirs [ i ] , " current " ) ; dirs add ( cur dir ) ; f s image test util assert reasonable name current dir ( cur dir ) ; } f s image test util assert parallel files are identical ( dirs , collections < string > empty set ( ) ) ; file dn cur dirs [ ] = new file [ data node dirs length ] ; for ( int i = 0 ; i < data node dirs length ; i + + ) { dn cur dirs [ i ] = new file ( data node dirs [ i ] , " current " ) ; assert equals ( upgrade utilities checksum contents ( data node , dn cur dirs [ i ] , false ) , upgrade utilities checksum master data node contents ( ) ) ; } for ( int i = 0 ; i < name node dirs length ; i + + ) { assert false ( new file ( name node dirs [ i ] , " previous " ) is directory ( ) ) ; } if ( bpid = = null ) { for ( int i = 0 ; i < data node dirs length ; i + + ) { assert false ( new file ( data node dirs [ i ] , " previous " ) is directory ( ) ) ; } } else { for ( int i = 0 ; i < data node dirs length ; i + + ) { file bp root = block pool slice storage get bp root ( bpid , dn cur dirs [ i ] ) ; assert false ( new file ( bp root , " previous " ) is directory ( ) ) ; file bp cur finalize dir = new file ( bp root , " current / " + data storage storage dir finalized ) ; assert equals ( upgrade utilities checksum contents ( data node , bp cur finalize dir , true ) , upgrade utilities checksum master block pool finalized contents ( ) ) ; } } }


add a new evaluator to the gauge statistics

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


public prepared statement prepare statement ( string sql , int [ ] column indexes ) throws s q l exception { if ( throw exception ) { throw new s q l exception ( ) ; } return new stub prepared statement ( this ) ; }


simulates a user initiated keystroke using the keybinding of the given action

public static void trigger action key ( component destination , docking action if action ) { objects require non null ( destination ) ; key stroke key stroke = action get key binding ( ) ; if ( key stroke = = null ) { throw new illegal argument exception ( " no key stroke assigned for the given action " ) ; } int modifiers = key stroke get modifiers ( ) ; int key code = key stroke get key code ( ) ; char key char = key stroke get key char ( ) ; boolean is defined = character is defined ( key char ) ; if ( ! is defined ) { key char = key event vk undefined ; } trigger key ( destination , modifiers , key code , key char ) ; }


exit a parse tree produced by { @ link eql base parser # string }

void exit string ( eql base parser string context ctx ) ;


public mixed properties and additional properties class map ( map < string , animal > map ) { this map = map ; return this ; }


apply a filtering function to the graph and return a sub - graph that satisfies the predicates only for the vertices

public graph < k , vv , ev > filter on vertices ( filter function < vertex < k , vv > > vertex filter ) { data set < vertex < k , vv > > filtered vertices = this vertices filter ( vertex filter ) ; data set < edge < k , ev > > remaining edges = this edges join ( filtered vertices ) where ( 0 ) equal to ( 0 ) with ( new project edge < > ( ) ) join ( filtered vertices ) where ( 1 ) equal to ( 0 ) with ( new project edge < > ( ) ) name ( " filter on vertices " ) ; return new graph < > ( filtered vertices , remaining edges , this context ) ; }


closed the resource guard this method will block until all calls to { @ link # acquire resource ( ) } have seen their matching call to { @ link # release resource ( ) }

public void close ( ) { close uninterruptibly ( ) ; }


get the interfaces from the schema ( composed )

public static list < schema > get interfaces ( composed schema composed ) { if ( composed get all of ( ) ! = null & & ! composed get all of ( ) is empty ( ) ) { return composed get all of ( ) ; } else if ( composed get any of ( ) ! = null & & ! composed get any of ( ) is empty ( ) ) { return composed get any of ( ) ; } else if ( composed get one of ( ) ! = null & & ! composed get one of ( ) is empty ( ) ) { return composed get one of ( ) ; } else { return collections < schema > empty list ( ) ; } }


returns an { @ link icon provider } for the given string value , which is usually the ' src ' attribute of an img tag

public static icon provider get icon for icons reference ( string snippet ) { string field name = get icon name ( snippet ) ; if ( field name = = null ) { return null ; } image icon icon = get icon by field name ( field name ) ; if ( icon = = null ) { return null ; } url url = get url from icon ( icon ) ; return new icon provider ( icon , url ) ; }


generates the files necessary for the rule

public void create files to generate ( build rule builder rule builder ) throws i o exception { for ( string file : rule builder get files to generate ( ) ) { scratch file ( file , " dummy " ) ; } }


assert a correctness of a change set with insertion data into a table

private static void assert insert data ( element change set ) { final element insert = get first element ( change set , " insert " ) ; assert that ( insert get attribute ( " catalog name " ) ) is equal to ( " test - db " ) ; assert that ( insert get attribute ( " schema name " ) ) is equal to ( " public " ) ; assert that ( insert get attribute ( " table name " ) ) is equal to ( " persons " ) ; final node list columns = insert get elements by tag name ( " column " ) ; final element id column = ( element ) columns item ( 0 ) ; assert that ( id column get attribute ( " name " ) ) is equal to ( " id " ) ; assert that ( id column get attribute ( " value numeric " ) ) is equal to ( " 1 " ) ; final element name column = ( element ) columns item ( 1 ) ; assert that ( name column get attribute ( " name " ) ) is equal to ( " name " ) ; assert that ( name column get attribute ( " value " ) ) is equal to ( " bill smith " ) ; final element email column = ( element ) columns item ( 2 ) ; assert that ( email column get attribute ( " name " ) ) is equal to ( " email " ) ; assert that ( email column get attribute ( " value " ) ) is equal to ( " bill @ smith me " ) ; }


create a series of class visitors which support types in later jdk core libraries on early java platforms

private class visitor create type based class visitors for classes in inputs ( class loader loader , @ nullable core library support core library support , class visitor base class visitor , invocation site transformation record builder call site record , boot class path digest boot class path digest , class attribute record class attribute record , consumer < close resource method scanner > close resource method scanner consumer , immutable set builder < class name > required runtime support types , class member retarget config class member retarget config ) { class visitor visitor = base class visitor ; if ( core library support ! = null ) { visitor = new immutable label remover ( visitor ) ; visitor = new emulated interface rewriter ( visitor , core library support ) ; visitor = new core package renamer ( visitor , core library support ) ; visitor = new core library invocation rewriter ( visitor , core library support ) ; if ( options auto desugar shadowed api use ) { visitor = new shadowed api invocation site ( visitor , call site record , boot class path digest , class attribute record , type hierarchy ) ; } } if ( ! allow try with resources ) { close resource method scanner close resource method scanner = new close resource method scanner ( ) ; close resource method scanner consumer accept ( close resource method scanner ) ; visitor = new try with resources rewriter ( visitor , loader , visited exception types , num of try with resources invoked , close resource method scanner has close resource method ( ) ) ; } if ( ! allow calls to objects non null ) { visitor = new objects require non null method rewriter ( visitor , rewriter ) ; } if ( ! allow calls to long compare ) { visitor = new long compare method rewriter ( visitor , rewriter ) ; } visitor = new class member retarget rewriter ( visitor , class member retarget config , required runtime support types ) ; visitor = nio buffer ref converter create ( visitor , rewriter get prefixer ( ) ) ; return visitor ; }


get either full or partial information about this cache pool

cache pool info get info ( boolean full info ) { cache pool info info = new cache pool info ( pool name ) ; if ( ! full info ) { return info ; } return info set owner name ( owner name ) set group name ( group name ) set mode ( new fs permission ( mode ) ) set limit ( limit ) set default replication ( default replication ) set max relative expiry ms ( max relative expiry ms ) ; }


determines whether the passed layout coordinates are visible in the display

private boolean is visible ( double x , double y ) { if ( viewer get component ( ) is visible ( ) & & ! viewer get bounds ( ) is empty ( ) ) { / / project the view bounds into the layout coordinate system , test for containing the coordinates return viewer get render context ( ) get multi layer transformer ( ) inverse transform ( viewer get bounds ( ) ) get bounds ( ) contains ( x , y ) ; } return true ; }


adds each element of { @ code elements } to the { @ code immutable multiset }

public builder < e > add ( e elements ) { super add ( elements ) ; return this ; }


load the version information from the federation state store


static job id new job id ( ) { random rn = new random ( ) ; final int range = 900000 ; final int randomadd = 100000 ; int random num = rn next int ( range ) + randomadd ; return new job id ( random num ) ; }


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


public set < string > get ephemerals ( long session id ) { return data tree get ephemerals ( session id ) ; }


creates a new program with specified name and language name the actual language object is located using the language name provided please note : the program is not automatically saved into the program

public program create program ( string program name , language i d language i d , compiler spec i d compiler spec i d ) throws exception { language language = get language ( language i d ) ; return create program ( program name , language , language get compiler spec by i d ( compiler spec i d ) ) ; }


forces the eviction jitter to be predictable

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


sets or removes the { @ code " expect : 100 - continue " } header to from the specified message if { @ code expected } is { @ code true } , the { @ code " expect : 100 - continue " } header is set and all other previous { @ code " expect " } headers are removed otherwise , all { @ code " expect " } headers are removed completely

public static void set 1 0 0 continue expected ( http message message , boolean expected ) { if ( expected ) { message headers ( ) set ( http header names expect , http header values continue ) ; } else { message headers ( ) remove ( http header names expect ) ; } }


returns the zip file entry for the specified name , or null if not found

public zip file entry get entry ( string name ) { return zip data get entry ( name ) ; }


format memory usage string for reporting

private string format usage string ( long current vmem usage , long vmem limit , long current pmem usage , long pmem limit ) { return string format ( " % s b of % s b physical memory used ; " + " % s b of % s b virtual memory used " , traditional binary prefix long 2 string ( current pmem usage , " " , 1 ) , traditional binary prefix long 2 string ( pmem limit , " " , 1 ) , traditional binary prefix long 2 string ( current vmem usage , " " , 1 ) , traditional binary prefix long 2 string ( vmem limit , " " , 1 ) ) ; }


variant of { @ link # intercept ( class , callable ) } to simplify void invocations

public static < e extends throwable > e intercept ( class < e > clazz , string contained , string message , void callable eval ) throws exception { return intercept ( clazz , contained , message , ( ) - > { eval call ( ) ; return " void " ; } ) ; }


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


calculates consistent stats for a symbol

private variable stats estimate normalize variable stats ( variable reference expression variable , variable stats estimate variable stats , plan node stats estimate stats ) { if ( variable stats is unknown ( ) ) { return variable stats estimate unknown ( ) ; } double output row count = stats get output row count ( ) ; check argument ( output row count > 0 , " output row count must be greater than zero : % s " , output row count ) ; double distinct values count = variable stats get distinct values count ( ) ; double nulls fraction = variable stats get nulls fraction ( ) ; if ( ! is na n ( distinct values count ) ) { type type = variable get type ( ) ; double max distinct values by low high = max distinct values by low high ( variable stats , type ) ; if ( distinct values count > max distinct values by low high ) { distinct values count = max distinct values by low high ; } if ( distinct values count > output row count ) { distinct values count = output row count ; } double non null values = output row count * ( 1 - nulls fraction ) ; if ( distinct values count > non null values ) { double difference = distinct values count - non null values ; distinct values count - = difference / 2 ; non null values + = difference / 2 ; nulls fraction = 1 - non null values / output row count ; } } if ( distinct values count = = 0 0 ) { return variable stats estimate zero ( ) ; } return variable stats estimate build from ( variable stats ) set distinct values count ( distinct values count ) set nulls fraction ( nulls fraction ) build ( ) ; }


sets a content type { @ link predicate } if a content type is rejected by the predicate then a { @ link http data source invalid content type exception } is thrown from { @ link # open ( data spec ) }

public void set content type predicate ( @ nullable predicate < string > content type predicate ) { this content type predicate = content type predicate ; }


if the service state is { @ link state # new } , this initiates service startup and returns immediately a stopped service may not be restarted


public void delete image ( ) { renderer delete image ( ) ; current bitmap = null ; request render ( ) ; }


adds the heuristic costs for network to the current heuristic network costs for this costs object

public void add heuristic network cost ( double cost ) { if ( cost < = 0 ) { throw new illegal argument exception ( " heuristic costs must be positive " ) ; } this heuristic network cost + = cost ; / / check for overflow if ( this heuristic network cost < 0 ) { this heuristic network cost = double max value ; } }


hash unsafe bytes , length must be aligned to 4 bytes

public static int hash unsafe bytes by words ( object base , long offset , int length in bytes ) { return hash unsafe bytes by words ( base , offset , length in bytes , default seed ) ; }


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

void enter process check ( eql base parser process check context ctx ) ;


creates a new message provider that provides only { @ link dynamic message dynamic messages } for the specified descriptors

public static descriptor message provider dynamic messages ( iterable < descriptor > descriptors ) { return new descriptor message provider ( ) ; }


expands a single argument , expanding options & at ; filename to read in the content of the file and add it to the list of processed arguments

private void expand argument ( string arg , list < string > expanded ) throws i o exception { if ( arg starts with ( " @ " ) ) { try ( input stream reader reader = new input stream reader ( file system get input stream ( arg substring ( 1 ) ) , iso 8859 1 ) ) { / / todo ( bazel - team ) : this code doesn ' t handle escaped newlines correctly / / shell utils doesn ' t support them either for ( string line : read all lines ( reader ) ) { list < string > parsed tokens = new array list < > ( ) ; try { shell utils tokenize ( parsed tokens , line ) ; } catch ( tokenization exception e ) { throw new i o exception ( " could not tokenize parameter file ! " , e ) ; } for ( string token : parsed tokens ) { expand argument ( token , expanded ) ; } } } } else { expanded add ( arg ) ; } }


use a helper method so there ' s no hidden reference remaining on the stack

private void allocate and leak allocation ( connection pool pool , real connection connection ) { ok http client client = new ok http client builder ( ) connection pool ( pool ) build ( ) ; real call call = ( real call ) client new call ( new request ( connection route ( ) address ( ) ) ) ; call enter network interceptor exchange ( call request ( ) , true ) ; synchronized ( connection ) { call acquire connection no events ( connection ) ; } }


the set of enumsflags defined in this attribute only makes sense if the format includes either format flags : : enum or format flags : : flags having both is an error < code > repeated aapt pb attribute symbol symbol = 4 ; < code >

public builder add all symbol ( java lang iterable < ? extends com android aapt resources attribute symbol > values ) { copy on write ( ) ; instance add all symbol ( values ) ; return this ; }


public void closed ( editor provider editor ) ;


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


configures { @ link # bind ( ) } to use the specified float { @ code value } for this uniform

public void set float ( float value ) { this value [ 0 ] = value ; }


public void test model 2 0 0 response ( ) { / / todo : test model 2 0 0 response }


get the location representation for the given index

public string get location representation ( big integer index ) { address addr = get address ( index ) ; if ( ! memory contains ( addr ) ) { return null ; } return addr to string ( ) ; }


public get basic status response get basic status ( request options options ) throws i o exception { return rest high level client perform request and parse entity ( validatable empty , request - > license request converters get license basic status ( ) , options , get basic status response : : from x content , empty set ( ) ) ; }


set all provided parameters replacing any existing values for the provided parameter names to add without replacing existing values , use { @ link # add parameters ( java util map ) }

public void set parameters ( map < string , ? > params ) { assert not null ( params , " parameter map must not be null " ) ; params for each ( ( key , value ) - > { if ( value instanceof string ) { set parameter ( key , ( string ) value ) ; } else if ( value instanceof string [ ] ) { set parameter ( key , ( string [ ] ) value ) ; } else { throw new illegal argument exception ( " parameter map value must be single value " + " or array of type [ " + string class get name ( ) + " ] " ) ; } } ) ; }


parses the { @ code < tx : annotation - driven > } tag will { @ link aop namespace utils # register auto proxy creator if necessary register an auto proxy creator } with the container as necessary

public bean definition parse ( element element , parser context parser context ) { register transactional event listener factory ( parser context ) ; string mode = element get attribute ( " mode " ) ; if ( " aspectj " equals ( mode ) ) { / / mode = " aspectj " register transaction aspect ( element , parser context ) ; if ( class utils is present ( " javax transaction transactional " , get class ( ) get class loader ( ) ) ) { register jta transaction aspect ( element , parser context ) ; } } else { / / mode = " proxy " aop auto proxy configurer configure auto proxy creator ( element , parser context ) ; } return null ; }


the " base 3 2 " encoding specified by < a href = " http : tools ietf orghtmlrfc 4 6 4 8 # section - 6 " > rfc 4648 section 6 , base 32 encoding ( this is the same as the base 32 encoding from < a href = " http : tools ietf orghtmlrfc 3 5 4 8 # section - 5 " > rfc 3548 ) the character { @ code ' = ' } is used for padding , but can be { @ linkplain # omit padding ( ) omitted } or { @ linkplain # with pad char ( char ) replaced } no line feeds are added by default , as per < a href = " http : tools ietf orghtmlrfc 4 6 4 8 # section - 3 1 " > rfc 4648 section 3 1 , line feeds in encoded data line feeds may be added using { @ link # with separator ( string , int ) }

public static base encoding base 3 2 ( ) { return base32 ; }


test whether an { @ link output type configurable } implementation gets called with the correct output type in this test case the output type must be basic type info int type info

public void test output type configuration with one input transformation ( ) throws exception { stream execution environment env = stream execution environment get execution environment ( ) ; data stream < integer > source = env from elements ( 1 , 10 ) ; output type configurable operation with one input output type configurable operation = new output type configurable operation with one input ( ) ; data stream < integer > result = source transform ( " single input and output type configurable operation " , basic type info int type info , output type configurable operation ) ; result add sink ( new discarding sink < > ( ) ) ; env get stream graph ( ) ; assert equals ( basic type info int type info , output type configurable operation get type information ( ) ) ; }


public void cr ( ) throws i o exception { write bytes ( cr ) ; }


public boolean allows multiple ( ) { return option annotation allow multiple ( ) ; }


the format of the data to be processed defaults to { @ link data description data format # xcontent }

public data format get format ( ) { return data format ; }


add an attribute to the model using a { @ link org springframework core conventions # get variable name generated name }


< code > optional string name = 2 ; < code >

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


returns the ratio of foreground playbacks which reached the ended state at least once , or { @ code 0 0 } if no playback has been in foreground

public float get ended ratio ( ) { return foreground playback count = = 0 ? 0f : ( float ) ended count / foreground playback count ; }


implementation of record reader : : get progress ( )

public float get progress ( ) throws i o exception , interrupted exception { final int num chunks left = get num chunks left ( ) ; if ( num chunks left < 0 ) { / / un - initialized i e before 1st dir - scan assert num records processed by this map < = num records per chunk : " num records processed by this map : " + num records processed by this map + " exceeds num records per chunk : " + num records per chunk ; return ( ( float ) num records processed by this map ) / total num records ; / / conservative estimate , till the first directory scan } return ( ( float ) num records processed by this map ) / ( num records processed by this map + num records per chunk * num chunks left ) ; }


returns whether the rpc endpoint is started and not stopped or being stopped

protected boolean is running ( ) { validate runs in main thread ( ) ; return is running ; }


returns the smallest power of two greater than or equal to { @ code x } this is equivalent to { @ code checked pow ( 2 , log 2 ( x , ceiling ) ) }

public static int ceiling power of two ( int x ) { check positive ( " x " , x ) ; if ( x > max signed power of two ) { throw new arithmetic exception ( " ceiling power of two ( " + x + " ) not representable as an int " ) ; } return 1 < < - integer number of leading zeros ( x - 1 ) ; }


private string get rpc xid ( sofa request sofa request ) { string rpc xid = ( string ) sofa request get request prop ( root context key xid ) ; if ( rpc xid = = null ) { rpc xid = ( string ) sofa request get request prop ( root context key xid to lower case ( ) ) ; } return rpc xid ; }


public static int parse ttml color ( string color expression ) { return parse color internal ( color expression , false ) ; }


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


public static set < member > select target members ( collection < member > members , predicate < member > filter ) { return members stream ( ) filter ( filter ) collect ( collectors to set ( ) ) ; }


gets the annotations out of a given class , similar to { @ link # get annotations } , also including annotations for translations of class - level attributes { @ code enclosing method } and { @ code inner classes } , if present additionally , if the class is an annotation class , then this also includes a representation of all the { @ code annotation default } values

public static annotations get class annotations ( direct class file cf , cf options args ) { cst type this class = cf get this class ( ) ; attribute list attribs = cf get attributes ( ) ; annotations result = get annotations ( attribs ) ; annotation enclosing method = translate enclosing method ( attribs ) ; try { annotations inner class annotations = translate inner classes ( this class , attribs , enclosing method = = null ) ; if ( inner class annotations ! = null ) { result = annotations combine ( result , inner class annotations ) ; } } catch ( warning warn ) { args warn println ( " warning : " + warn get message ( ) ) ; } if ( enclosing method ! = null ) { result = annotations combine ( result , enclosing method ) ; } if ( access flags is annotation ( cf get access flags ( ) ) ) { annotation annotation default = translate annotation defaults ( cf ) ; if ( annotation default ! = null ) { result = annotations combine ( result , annotation default ) ; } } return result ; }


added to verify http : code google compgoogle - gsonissuesdetail ? id = 68

public void test null wrapped primitive member serialization ( ) { gson gson = gson builder serialize nulls ( ) create ( ) ; class with null wrapped primitive target = new class with null wrapped primitive ( ) ; string json = gson to json ( target ) ; assert true ( json contains ( " \ " value \ " : null " ) ) ; }


collect all the storage movement attempt finished blocks later this will be send to namenode via heart beat

public void handle ( block movement attempt finished move attempt finished blk ) { / / adding to the tracking report list later this can be accessed to know / / the attempted block movements synchronized ( block id vs movement status ) { block id vs movement status add ( move attempt finished blk get block ( ) ) ; } }


converts a collection of { @ link path } to a collection of dynamo d b keys

static primary key [ ] path to key ( collection < path > paths ) { if ( paths = = null ) { return null ; } final primary key [ ] keys = new primary key [ paths size ( ) ] ; int i = 0 ; for ( path p : paths ) { keys [ i + + ] = path to key ( p ) ; } return keys ; }


creates the string for the option or choice column of a row

private string get choice ( string version , equate equate ) { if ( equate = = null ) { return " no equate as in ' " + version + " ' version " ; } return " keep ' " + version + " ' version " ; }


public list < update container request > get demotion requests ( ) { return demotion requests ; }


gets whether to set filter bitmap flag flag to paint

public boolean get paint filter bitmap ( ) { return m paint filter bitmap ; }


public void set label ( string label ) { new label ( label ) ; measure ( ) ; repaint ( ) ; }


performs a state update and returns the new view

public litho view assert after state update ( ) { return litho view assert assert that ( state updates test helper get view after state update ( m component context , actual ) ) ; }


the set of xml attributevalue pairs for this style < code > repeated aapt pb style entry entry = 3 ; < code >

public int get entry count ( ) { return instance get entry count ( ) ; }


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

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


set the default file system uri in a configuration

public static void set default uri ( configuration conf , uri uri ) { conf set ( fs default name key , uri to string ( ) ) ; }


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


public static string to string ( byte [ ] client id ) { / / client id can be null or an empty array if ( client id = = null | | client id length = = 0 ) { return " " ; } / / otherwise should be 16 bytes preconditions check argument ( client id length = = byte length ) ; long msb = get msb ( client id ) ; long lsb = get lsb ( client id ) ; return ( new uuid ( msb , lsb ) ) to string ( ) ; }


public void write stack value ( int relative offset , int size , big integer value ) throws exception { / / todo : verify that sign byte is not added to size of bytes long offset = read register ( stack ptr reg ) long value ( ) + relative offset ; byte [ ] bytes = converter get bytes ( value , size ) ; write memory ( stack memory space get address ( offset ) , bytes ) ; }


set whether the { @ code j m x connector server } should be started in a separate thread

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


update the quota usage after deletion the quota update is only necessary when imageedits have been loaded and the filedir to be deleted is not contained in snapshots

void update count for delete ( final i node inode , final i nodes in path iip ) { if ( get f s namesystem ( ) is image loaded ( ) & & ! inode is in latest snapshot ( iip get latest snapshot id ( ) ) ) { quota counts counts = inode compute quota usage ( get block storage policy suite ( ) ) ; unprotected update count ( iip , iip length ( ) - 1 , counts negation ( ) ) ; } }


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


tests that { @ link local input channel # request subpartition ( int ) } throws { @ link partition not found exception } if the result partition was not registered in { @ link result partition manager } and no backoff

public void test partition not found exception while requesting partition ( ) throws exception { final single input gate input gate = create single input gate ( 1 ) ; final local input channel local channel = create local input channel ( input gate , new result partition manager ( ) ) ; try { local channel request subpartition ( 0 ) ; fail ( " should throw a partition not found exception " ) ; } catch ( partition not found exception not found ) { assert that ( local channel get partition id ( ) , matchers is ( not found get partition id ( ) ) ) ; } }


sets whether or not negative numbers are accepted

public void set allow negative values ( boolean b ) { big integer current value = get value ( ) ; allows negative = b ; if ( ! allows negative ) { if ( current value ! = null & & current value compare to ( big integer zero ) < 0 ) { current value = null ; } } update text field ( current value ) ; }


specifies the border radius for all corners

public builder radius attr ( @ attr res int attr id ) { return radius attr ( attr id , 0 ) ; }


get the target start time of this task in ms

public final long start ms ( ) { return start ms ; }


asynchronous version of { @ link abstract dao # load all ( ) }

public async operation load all ( class < ? > entity class ) { return load all ( entity class , 0 ) ; }


obtain the size in bits of a textual operand this is a little odd , since the variables in pattern expressions do not have an explicit size however , the value exported by a constructor ' s p code may have an explicit size given ( in bytes ) thus , there is a special case , where a constructor prints just one operand and exports that same operand with an explicit size in that case , the size of the operand is printed according to that exported size for disassembly , this information is used simply to truncate the bits before they are displayed for assembly , we must do two things : 1 ) ensure that the provided value fits in the given size , and 2 ) mask the goal when solving the pattern expression for the operand

protected int get bit size ( constructor cons , operand symbol opsym ) { construct tpl ctpl = cons get templ ( ) ; if ( null = = ctpl ) { / / no pcode , no size specification return 0 ; } handle tpl htpl = ctpl get result ( ) ; if ( null = = htpl ) { / / if nothing is exported , the size is unspecified return 0 ; } if ( opsym get index ( ) ! = htpl get offset operand index ( ) ) { / / if the export is not of the same operand , it does not specify its size return 0 ; } return htpl get size ( ) ; }


parse an animation from srcmainassets it is recommended to use { @ link # from raw res ( context , int ) } instead the asset file name will be used as a cache key so future usages won ' t have to parse the json again however , if your animation has images , you may package the json and images as a single flattened zip file in assets to skip the cache , add null as a third parameter

public static lottie task < lottie composition > from asset ( context context , final string file name ) { string cache key = " asset " + file name ; return from asset ( context , file name , cache key ) ; }


tries to release many memory segments together the segment is only freed and made eligible for reclamation by the gc each segment will be returned to the memory pool , increasing its available limit for the later allocations

public void release ( collection < memory segment > segments ) { if ( segments = = null ) { return ; } preconditions check state ( ! is shut down , " memory manager has been shut down " ) ; / / since concurrent modifications to the collection / / can disturb the release , we need to try potentially multiple times boolean successfully released = false ; do { / / we could just pre - sort the segments by owner and release them in a loop by owner / / it would simplify the code but require this additional step and memory for the sorted / / map of segments by owner / / current approach is more complicated but it traverses the input segments only once / / w / o any additional buffer / / later , we can check whether the simpler approach actually leads to any performance / / penalty and / / if not , we can change it to the simpler approach for the better readability iterator < memory segment > segments iterator = segments iterator ( ) ; try { memory segment segment = null ; while ( segment = = null & & segments iterator has next ( ) ) { segment = segments iterator next ( ) ; } while ( segment ! = null ) { segment = release segments for owner until next owner ( segment , segments iterator ) ; } segments clear ( ) ; / / the only way to exit the loop successfully released = true ; } catch ( concurrent modification exception | no such element exception e ) { / / this may happen in the case where an asynchronous / / call releases the memory fall through the loop and try again } } while ( ! successfully released ) ; }


return an identifier for the listener to be able to refer to it individually it might be necessary for specific completion callback implementations to provide a specific id , whereas for other scenarios an empty string ( as the common default value ) is acceptable as well

default string get listener id ( ) { return " " ; }


test that a configuration with no leader election configured fails

public void test h a conf without leader election ( ) { configuration conf = new configuration ( configuration ) ; conf set boolean ( yarn configuration rm ha enabled , true ) ; conf set boolean ( yarn configuration auto failover enabled , true ) ; conf set boolean ( yarn configuration auto failover embedded , false ) ; conf set boolean ( yarn configuration curator leader elector , false ) ; conf set ( yarn configuration rm ha ids , " rm 1 , rm 2 " ) ; int base = 100 ; for ( string conf key : yarn configuration get service address conf keys ( configuration ) ) { conf set ( h a util add suffix ( conf key , " rm 1 " ) , " 0 0 0 0 : " + ( base + 20 ) ) ; conf set ( h a util add suffix ( conf key , " rm 2 " ) , " 0 0 0 0 : " + ( base + 40 ) ) ; base = base * 2 ; } conf set ( yarn configuration rm ha id , " rm 1 " ) ; check bad configuration ( conf ) ; }


public void run ( ) { while ( running & & get conf ( ) get ( prop1 ) equals ( val1 ) ) { try { thread sleep ( 1 ) ; } catch ( interrupted exception ignore ) { / / do nothing } } }


returns true if the chart is empty ( meaning it ' s data object is either null or contains no entries )

public boolean is empty ( ) { if ( m data = = null ) return true ; else { if ( m data get entry count ( ) < = 0 ) return true ; else return false ; } }


{ @ inherit doc } this implementation is correct for single consumer thread use only

public t poll ( ) { / / local load of field to avoid repeated loads after volatile reads final atomic reference array < object > buffer = consumer buffer ; final long index = lp consumer index ( ) ; final int mask = consumer mask ; final int offset = calc wrapped offset ( index , mask ) ; final object e = lv element ( buffer , offset ) ; / / load load boolean is next buffer = e = = has next ; if ( null ! = e & & ! is next buffer ) { so element ( buffer , offset , null ) ; / / store store so consumer index ( index + 1 ) ; / / this ensures correctness on 3 2bit platforms return ( t ) e ; } else if ( is next buffer ) { return new buffer poll ( lv next buffer and unlink ( buffer , mask + 1 ) , index , mask ) ; } return null ; }


add files in the input path recursively into the results

protected void add input path recursively ( list < file status > result , file system fs , path path , path filter input filter ) throws i o exception { remote iterator < located file status > iter = fs list located status ( path ) ; while ( iter has next ( ) ) { located file status stat = iter next ( ) ; if ( input filter accept ( stat get path ( ) ) ) { if ( stat is directory ( ) ) { add input path recursively ( result , fs , stat get path ( ) , input filter ) ; } else { result add ( shrink status ( stat ) ) ; } } } }


build j unit test suite for the specified package test suite includes sub - test suites for each sub - package

public static test suite get test suite ( string pkg name ) { return get test suite ( pkg name , true ) ; }


public void directory created ( ) { increment counter ( directories created , 1 ) ; }


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

public boolean is set arg ( ) { return isset bit vector get ( arg isset id ) ; }


public void execute ( file system fs ) throws i o exception { fs rename snapshot ( path , old snapshot name , snapshot name ) ; return null ; }


updates a pet in the store with form data

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


given a { @ link stream info } and the existing queue items , provide the { @ link single play queue } consisting of the next video for auto queueing this method detects and prevents cycles by naively checking if a candidate next video ' s url already exists in the existing items the first item in { @ link stream info # get related streams ( ) } is checked first if it is non - null and is not part of the existing items , it will be used as the next stream otherwise , a random item with non - repeating url will be selected from the { @ link stream info # get related streams ( ) }

public static play queue auto queue of ( @ non null final stream info info , @ non null final list < play queue item > existing items ) { final set < string > urls = new hash set < > ( existing items size ( ) ) ; for ( final play queue item item : existing items ) { urls add ( item get url ( ) ) ; } final list < info item > related items = info get related streams ( ) ; if ( utils is null or empty ( related items ) ) { return null ; } if ( related items get ( 0 ) ! = null & & related items get ( 0 ) instanceof stream info item & & ! urls contains ( related items get ( 0 ) get url ( ) ) ) { return get auto queued single play queue ( ( stream info item ) related items get ( 0 ) ) ; } final list < stream info item > auto queue items = new array list < > ( ) ; for ( final info item item : related items ) { if ( item instanceof stream info item & & ! urls contains ( item get url ( ) ) ) { auto queue items add ( ( stream info item ) item ) ; } } collections shuffle ( auto queue items ) ; return auto queue items is empty ( ) ? null : get auto queued single play queue ( auto queue items get ( 0 ) ) ; }


public static map < string , list < object > > collect attributes from entity ( final json object couchbase entity , final predicate < string > filter ) { return couchbase entity get names ( ) stream ( ) filter ( filter ) map ( name - > pair of ( name , couchbase entity get ( name ) ) ) collect ( collectors to map ( pair : : get key , s - > collection utils wrap list ( s get value ( ) ) ) ) ; }


extracts the id of the user from the provided credential this method should be overridden by subclasses to achieve more sophisticated strategies for producing a principal id from a credential

protected string extract principal id ( final credential credential , final optional < principal > current principal ) { logger debug ( " extracting credential id based on existing credential [ { } ] " , credential ) ; val id = credential get id ( ) ; if ( current principal is present ( ) ) { val principal = current principal get ( ) ; logger debug ( " principal is currently resolved as [ { } ] " , principal ) ; if ( context is use current principal id ( ) ) { logger debug ( " using the existing resolved principal id [ { } ] " , principal get id ( ) ) ; return principal get id ( ) ; } else { logger debug ( " cas will not be using the identifier from the resolved principal [ { } ] as it ' s not " + " configured to use the currently - resolved principal id and will fall back onto using the identifier " + " for the credential , that is [ { } ] , for principal resolution " , principal , id ) ; } } else { logger debug ( " no principal is currently resolved and available falling back onto using the identifier " + " for the credential , that is [ { } ] , for principal resolution " , id ) ; } logger debug ( " extracted principal id [ { } ] " , id ) ; return id ; }


returns the default value if the column doesn ' t exist or the result was null

static < t > t maybe get ( record record , table field < record , t > field , t default value ) { if ( record fields row ( ) index of ( field ) < 0 ) { return default value ; } else { t result = record get ( field ) ; return result ! = null ? result : default value ; } }


public void test big cat all of ( ) { / / todo : test big cat all of }


sets the kind of change that this row describes in a changelog by default , a row describes an { @ link row kind # insert } change

public void set kind ( row kind kind ) { preconditions check not null ( kind , " row kind must not be null " ) ; this kind = kind ; }


public mutable counter int new counter ( string name , string desc , int i val ) { return new counter ( interns info ( name , desc ) , i val ) ; }


tests the heartbeat interplay between the { @ link heartbeat manager impl } and the { @ link heartbeat manager sender impl } the sender should regularly trigger heartbeat requests which are fulfilled by the receiver upon stopping the receiver , the sender should notify the heartbeat listener about the heartbeat timeout

public void test heartbeat cluster ( ) throws exception { resource i d resource id target = new resource i d ( " foobar " ) ; resource i d resource i d sender = new resource i d ( " barfoo " ) ; final int target payload = 42 ; final atomic integer num report payload calls target = new atomic integer ( 0 ) ; final testing heartbeat listener < string , integer > heartbeat listener target = new testing heartbeat listener builder < string , integer > ( ) set retrieve payload function ( ignored - > target payload ) set report payload consumer ( ( ignored a , ignored b ) - > num report payload calls target increment and get ( ) ) create new testing heartbeat listener ( ) ; final string sender payload = " 1337 " ; final completable future < resource i d > target heartbeat timeout future = new completable future < > ( ) ; final atomic integer num report payload calls sender = new atomic integer ( 0 ) ; final testing heartbeat listener < integer , string > heartbeat listener sender = new testing heartbeat listener builder < integer , string > ( ) set retrieve payload function ( ignored - > sender payload ) set notify heartbeat timeout consumer ( target heartbeat timeout future : : complete ) set report payload consumer ( ( ignored a , ignored b ) - > num report payload calls sender increment and get ( ) ) create new testing heartbeat listener ( ) ; heartbeat manager impl < string , integer > heartbeat manager target = new heartbeat manager impl < > ( heartbeat timeout , resource id target , heartbeat listener target , testing utils default scheduled executor ( ) , log ) ; heartbeat manager sender impl < integer , string > heartbeat manager sender = new heartbeat manager sender impl < > ( heartbeat interval , heartbeat timeout , resource i d sender , heartbeat listener sender , testing utils default scheduled executor ( ) , log ) ; heartbeat manager target monitor target ( resource i d sender , heartbeat manager sender ) ; heartbeat manager sender monitor target ( resource id target , heartbeat manager target ) ; thread sleep ( 2 * heartbeat timeout ) ; assert false ( target heartbeat timeout future is done ( ) ) ; heartbeat manager target stop ( ) ; resource i d timeout resource i d = target heartbeat timeout future get ( 2 * heartbeat timeout , time unit milliseconds ) ; assert that ( timeout resource i d , is ( resource id target ) ) ; int number heartbeats = ( int ) ( 2 * heartbeat timeout / heartbeat interval ) ; final matcher < integer > number heartbeats matcher = greater than or equal to ( number heartbeats / 2 ) ; assert that ( num report payload calls target get ( ) , is ( number heartbeats matcher ) ) ; assert that ( num report payload calls sender get ( ) , is ( number heartbeats matcher ) ) ; }


prepare an instance to in - place decode the given byte string buffers

public static block list as longs decode buffers ( final int num blocks , final list < byte string > blocks bufs , final int max data length ) { / / this doesn ' t actually copy the data return decode buffer ( num blocks , byte string copy from ( blocks bufs ) , max data length ) ; }


invoked from a container thread when an error occurred while processing an async request before the { @ code deferred result } has been set implementations may invoke { @ link deferred result # set result ( object ) set result } or { @ link deferred result # set error result ( object ) set error result } to resume processing

default < t > boolean handle error ( native web request request , deferred result < t > deferred result , throwable t ) throws exception { return true ; }


public sql return type get sql return type ( ) { return this sql return type ; }


returns number of shards that should be used for routing by default this method will return the number of shards for this index

public int get routing num shards ( ) { return routing num shards = = null ? number of shards ( ) : routing num shards ; }


initializes an existing index , to be restored from a snapshot

public builder initialize as restore ( index metadata index metadata , snapshot recovery source recovery source ) { final unassigned info unassigned info = new unassigned info ( unassigned info reason existing index restored , " restore source [ " + recovery source snapshot ( ) get repository ( ) + " / " + recovery source snapshot ( ) get snapshot id ( ) get name ( ) + " ] " ) ; return initialize as restore ( index metadata , recovery source , null , false , unassigned info ) ; }


if a value of 0 is set then this attribute will revert to its default value optional : default value is ( char sequence ) null

public test many types view model title ( @ string res int string res , object format args ) { on mutation ( ) ; title string attribute data set value ( string res , format args ) ; return this ; }


return the patterns in this condition if only the first ( top ) pattern is needed use { @ link # get first pattern ( ) }

public set < path pattern > get patterns ( ) { return this patterns ; }


post - processes a test immediately after execution of the { @ link java lang reflect method test method } in the supplied { @ link test context test context } & mdash ; for example , for timing or logging purposes this method must be called before framework - specific after lifecycle callbacks the default implementation is empty can be overridden by concrete classes as necessary

default void after test execution ( test context test context ) throws exception { }


destroys the filter this implementation is a nop


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


public cancellable get api key async ( final get api key request request , final request options options , final action listener < get api key response > listener ) { return rest high level client perform request async and parse entity ( request , security request converters : : get api key , options , get api key response : : from x content , listener , empty set ( ) ) ; }


long release ( long count ) { count = rounder round up ( count ) ; return used bytes add and get ( - count ) ; }


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


sets the empty subscription instance on the subscriber and then calls on error with the supplied error make sure this is only called if the subscriber hasn ' t received a subscription already ( there is no way of telling this )

public static void error ( throwable e , subscriber < ? > s ) { s on subscribe ( instance ) ; s on error ( e ) ; }


to test enum parameters to test enum parameters

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


update ( a portion of ) the instance data does not resize the backing buffer

public mesh update instance data ( int target offset , float [ ] source ) { return update instance data ( target offset , source , 0 , source length ) ; }


removes all { @ link android graphics bitmap } s from the pool


get the address set for the given group if group is a module , then recursively call this method for all descendants

private void get address set ( group group , address set set ) { if ( group instanceof program fragment ) { set add ( ( program fragment ) group ) ; } else { group [ ] groups = ( ( program module ) group ) get children ( ) ; for ( group group 2 : groups ) { get address set ( group 2 , set ) ; } } }


copies playback info with new playback state

public playback info copy with playback state ( int playback state ) { return new playback info ( timeline , period id , requested content position us , playback state , playback error , is loading , track groups , track selector result , loading media period id , play when ready , playback suppression reason , playback parameters , buffered position us , total buffered duration us , position us , offload scheduling enabled ) ; }


public int get key length ( ) { return klen ; }


convenience method for { @ link # add listener ( job tracker job filter , job tracker job listener ) } that takes in an id to filter on

public void add listener ( @ non null string id , @ non null job tracker job listener listener ) { job tracker add listener ( new job id filter ( id ) , listener ) ; }


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


create a new { @ code k table } by transforming the value of each record in this { @ code k table } into a new value ( with possibly a new type ) in the new { @ code k table } , with the { @ link serde key serde } , { @ link serde value serde } , and the underlying { @ link key value store materialized state storage } configured in the { @ link materialized } instance for each { @ code k table } update the provided { @ link value mapper with key } is applied to the value of the update record and computes a new value for it , resulting in an updated record for the result { @ code k table } thus , an input record { @ code < k , v > } can be transformed into an output record { @ code < k : v ' > } this is a stateless record - by - record operation the example below counts the number of token of value and key strings { @ code k table < string , string > input table = builder table ( " topic " ) ; k table < string , integer > output table = input table map value ( new value mapper with key < string , string , integer > { integer apply ( string read only key , string value ) { return read only key split ( " " ) length + value split ( " " ) length ; } } ) ; } to query the local { @ link key value store } representing output table above it must be obtained via { @ link kafka streams # store ( store query parameters ) } kafka streams # store ( ) } : for non - local keys , a custom rpc mechanism must be implemented using { @ link kafka streams # all metadata ( ) } to query the value of the key on a parallel running instance of your kafka streams application the store name to query with is specified by { @ link materialized # as ( string ) } or { @ link materialized # as ( key value bytes store supplier ) } note that the key is read - only and should not be modified , as this can lead to corrupt partitioning this operation preserves data co - location with respect to the key thus , no internal data redistribution is required if a key based operator ( like a join ) is applied to the result { @ code k table } note that { @ code map values } for a changelog stream works differently than { @ link k stream # map values ( value mapper ) record stream filters } , because { @ link key value records } with { @ code null } values ( so - called tombstone records ) have delete semantics thus , for tombstones the provided value - mapper is not evaluated but the tombstone record is forwarded directly to delete the corresponding record in the result { @ code k table }

< vr > k table < k , vr > map values ( final value mapper with key < ? super k , ? super v , ? extends vr > mapper , final materialized < k , vr , key value store < bytes , byte [ ] > > materialized ) ;


public void anytype 2 test ( ) { / / todo : test anytype 2 }


public string get connector info ( ) { return " json cluster connector : connects to a json file that describes a " + " cluster : " + cluster u r i to string ( ) ; }


puts a shared element to transitions and names

private void map shared element ( list < string > names , map < string , view > shared elements , view view ) { string transition name = view get transition name ( ) ; names add ( transition name ) ; shared elements put ( transition name , view ) ; }


return the name of a subscription to create , if any

public string get subscription name ( ) { return this subscription name ; }


optionally create a type - safe synthesized version of this annotation based on a condition predicate the result is synthesized using a jdk { @ link proxy } and as a result may incur a computational cost when first invoked consult the documentation for { @ link # synthesize ( ) } for an explanation of what is considered synthesizable

optional < a > synthesize ( predicate < ? super merged annotation < a > > condition ) throws no such element exception ;


this method sets the automatically computed colors for the legend use set custom ( ) to set custom colors

public void set entries ( list < legend entry > entries ) { m entries = entries to array ( new legend entry [ entries size ( ) ] ) ; }


call < void > update pet ( @ retrofit 2 http body pet body ) ;


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


merge replaces when the given key is present

public void test merge 2 ( ) { concurrent map map = map 5 ( ) ; assert equals ( " z " , map merge ( one , " y " , ( x , y ) - > " z " ) ) ; }


get the number of header bytes the format checker requires


return the type of map with the { @ code key type } and { @ code value type }

public static type get map type ( @ non null final type key type , @ non null final type value type ) { return type token get parameterized ( map class , key type , value type ) get type ( ) ; }


mirror ' s { @ link g file system # lookup ( string ) } interface

public g file lookup ( string path ) { string [ ] nameparts = ( path ! = null ? path : " " ) split ( " / " ) ; g file parent = lookup parent ( nameparts ) ; if ( nameparts length = = 0 ) { return parent ; } string name = nameparts [ nameparts length - 1 ] ; if ( name = = null | | name is empty ( ) ) { return parent ; } map < string , g file > dir listing = get directory contents ( parent , false ) ; return ( dir listing ! = null ) ? dir listing get ( name ) : null ; }


register a listener that will be called when this model is unbound from a view the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules you may clear the listener by setting a null value , or by calling { @ link # reset ( ) }

public base model view model on unbind ( on model unbound listener < base model view model , base model view > listener ) { on mutation ( ) ; this on model unbound listener epoxy generated model = listener ; return this ; }


resolve the given destination name into a jms { @ link destination } , via this accessor ' s { @ link destination resolver }

protected destination resolve destination name ( session session , string destination name ) throws j m s exception { return get destination resolver ( ) resolve destination name ( session , destination name , is pub sub domain ( ) ) ; }


control whether the egl context is preserved when the g l texture view is paused and resumed if set to true , then the egl context may be preserved when the g l texture view is paused whether the egl context is actually preserved or not depends upon whether the android device that the program is running on can support an arbitrary number of egl contexts or not devices that can only support a limited number of egl contexts must release the egl context in order to allow multiple applications to share the gpu if set to false , the egl context will be released when the g l texture view is paused , and recreated when the g l texture view is resumed the default is false

public void set preserve e g l context on pause ( boolean preserve on pause ) { preserve e g l context on pause = preserve on pause ; }


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


returns an image descriptor for the image file at the given plug - in relative path

public static image descriptor get image descriptor ( string path ) { return image descriptor from plugin ( plugin id , path ) ; }


returns the head buffer segment or null if the list is empty

public object [ ] head ( ) { return head ; / / nopmd }


public static void set ip address ( string ip address ) { xid ip address = ip address ; }


convert to an { @ code int } number of bytes callers are expected to be certain this will not overflow

public final int to int bytes ( long size ) { final long l = to bytes ( size ) ; final int i = ( int ) l ; if ( i ! = l ) { final string message = " could not convert [ " + size + " " + this + " ] to an int " ; assert false : message ; throw new illegal argument exception ( message ) ; } return i ; }


create the frq in a method that goes out of scope so that we ' re sure it will be reclaimed

private void weakly reference queue ( ) { frq = new finalizable reference queue ( ) ; queue reference = new weak reference < > ( frq queue ) ; / * * queue and clear a reference for good measure we test later on that * the finalizer thread stopped , but we should test that it actually * started first * / reference = new finalizable weak reference < object > ( new object ( ) , frq ) { @ override public void finalize referent ( ) { reference = null ; frq = null ; } } ; }


public completable future < void > delete pet ( long pet id , string api key ) throws api exception { try { http request builder local var request builder = delete pet request builder ( pet id , api key ) ; return member var http client send async ( local var request builder build ( ) , http response body handlers of string ( ) ) then compose async ( local var response - > { if ( local var response status code ( ) / 100 ! = 2 ) { return completable future failed future ( get api exception ( " delete pet " , local var response ) ) ; } return completable future completed future ( null ) ; } ) ; } catch ( api exception e ) { return completable future failed future ( e ) ; } }


optional method to determine the target topic for the element


this method performs an asynchronous ldap search operation that could have multiple results

public static void search ( l d a p connection ldap , string base d n , search scope scope , filter filter , int time limit seconds , boolean ignore referral errors , action listener < list < search result entry > > listener , string attributes ) { ldap search result listener search result listener = new ldap search result listener ( ldap , ignore referral errors , action listener wrap ( search result - > { assert is ldap connection thread ( thread current thread ( ) ) : " expected current thread [ " + thread current thread ( ) + " ] to be an l d a p connection reader thread probably the new library has changed the thread ' s name " ; listener on response ( collections unmodifiable list ( search result get search entries ( ) ) ) ; } , listener : : on failure ) , 1 ) ; try { search request request = new search request ( search result listener , base d n , scope , dereference policy never , 0 , time limit seconds , false , filter , attributes ) ; search result listener set search request ( request ) ; ldap async search ( request ) ; } catch ( l d a p exception e ) { listener on failure ( e ) ; } }


returns a list of file basenames to be excluded from the output may be empty

immutable sorted set < string > get excluded files ( ) ;


schedules a periodic execution of the given task with the given initial time delay and repeat period the default implementation schedules and reschedules the { @ code runnable } task via the { @ link # schedule ( runnable , long , time unit ) } method over and over and at a fixed rate , that is , the first execution will be after the { @ code initial delay } , the second after { @ code initial delay + period } , the third after { @ code initial delay + 2 period } , and so on note to implementors : non - positive { @ code initial time } and { @ code period } should be regarded as non - delayed scheduling of the first and any subsequent executions in addition , a more specific { @ code worker } implementation should override this method if it can perform the periodic task execution with less overhead ( such as by avoiding the creation of the wrapper and tracker objects upon each periodic invocation of the common { @ link # schedule ( runnable , long , time unit ) } method )

public disposable schedule periodically ( @ non null runnable run , final long initial delay , final long period , @ non null final time unit unit ) { final sequential disposable first = new sequential disposable ( ) ; final sequential disposable sd = new sequential disposable ( first ) ; final runnable decorated run = rx java plugins on schedule ( run ) ; final long period in nanoseconds = unit to nanos ( period ) ; final long first now nanoseconds = now ( time unit nanoseconds ) ; final long first start in nanoseconds = first now nanoseconds + unit to nanos ( initial delay ) ; disposable d = schedule ( new periodic task ( first start in nanoseconds , decorated run , first now nanoseconds , sd , period in nanoseconds ) , initial delay , unit ) ; if ( d = = empty disposable instance ) { return d ; } first replace ( d ) ; return sd ; }


the actual value for the attribute for the analysis phase , which depends on the build configuration note that configurations transitions are applied after the late - bound attribute was evaluated

public abstract value t resolve ( rule rule , attribute map attributes , fragment t input ) ;


set the classpath to search for classes to load this should not be changed once the classloader starts to server classes

public void set class path ( path classpath ) { path components clear ( ) ; if ( classpath ! = null ) { path actual classpath = classpath concat system classpath ( " ignore " ) ; string [ ] path elements = actual classpath list ( ) ; for ( string path element : path elements ) { try { add path element ( path element ) ; } catch ( build exception e ) { / / ignore path elements which are invalid / / relative to the project } } } }


return a unix command to get permission information

public static string [ ] get g e t permission command ( ) { / / force / bin / ls , except on windows return new string [ ] { ( windows ? " ls " : " / bin / ls " ) , " - ld " } ; }


returns the finished { @ link dex archive provider }

public dex archive provider build ( ) { return new dex archive provider ( transitive dex archives add ( immutable table copy of ( dex archives ) ) build ( ) ) ; }


create a new { @ link converting comparator } that compares { @ linkplain java util map entry map entries } based on their { @ linkplain java util map entry # get key ( ) keys }

public static < k , v > converting comparator < map entry < k , v > , k > map entry keys ( comparator < k > comparator ) { return new converting comparator < > ( comparator , map entry : : get key ) ; }


the pipelined partition releases automatically once all subpartition readers are released that is because pipelined partitions cannot be consumed multiple times , or reconnect

void on consumed subpartition ( int subpartition index ) { if ( is released ( ) ) { return ; } final int remaining unconsumed ; / / we synchronize only the bookkeeping section , to avoid holding the lock during any / / calls into other components synchronized ( release lock ) { if ( consumed subpartitions [ subpartition index ] ) { / / repeated call - ignore return ; } consumed subpartitions [ subpartition index ] = true ; remaining unconsumed = ( - - num unconsumed subpartitions ) ; } log debug ( " { } : received consumed notification for subpartition { } " , this , subpartition index ) ; if ( remaining unconsumed = = 0 ) { partition manager on consumed partition ( this ) ; } else if ( remaining unconsumed < 0 ) { throw new illegal state exception ( " received consume notification even though all subpartitions are already consumed " ) ; } }


< code > optional bool sex = 5 ; < code >

public builder clear sex ( ) { bit field 0 = ( bit field 0 & ~ 0x 0 0 0 0 0 0 1 0 ) ; sex = false ; on changed ( ) ; return this ; }


check that the no parameter constructor works correctly

public void constructor blank ( ) throws i o exception { file status file status = new file status ( ) ; validate accessors ( file status , 0 , false , 0 , 0 , 0 , 0 , fs permission get file default ( ) , " " , " " , null , null ) ; }


public test field prop model prop view model value ( int value ) { on mutation ( ) ; this value int = value ; return this ; }


return a file status object that represents the path

public file status get file status ( final path f ) throws i o exception { entry point ( invocation get file status ) ; return inner get file status ( f , false , status probe enum all ) ; }


clicks a range of items in a list ( simulates holding shift and selecting each item in the range in - turn )

public static void click list range ( final j list < ? > list , final int row , int count ) { wait for swing ( ) ; for ( int i = row ; i < row + count ; i + + ) { rectangle rect = list get cell bounds ( i , i ) ; click mouse ( list , mouse event button1 , rect x + 10 , rect y + 10 , 1 , input event shift down mask ) ; } wait for swing ( ) ; }


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

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


assemble a line instruction at the given address , assuming the given context this method works like { @ link # assemble line ( address , string ) } except that it allows you to override the assumed context at that location

public byte [ ] assemble line ( address at , string line , assembly pattern block ctx ) throws assembly semantic exception , assembly syntax exception ;


assert the response status code is { @ code http status checkpoint } ( 103 )

public result matcher is checkpoint ( ) { return matcher ( http status value of ( 103 ) ) ; }


is google authenticator multiple device registration enabled ?

public static boolean is google authenticator multiple device registration enabled ( final request context request context ) { return request context get flow scope ( ) get ( " gauth multiple device registration enabled " , boolean class ) ; }


sets the major version and the name of the class to which this symbol table belongs also adds the class name to the constant pool

int set major version and class name ( final int major version , final string class name ) { this major version = major version ; this class name = class name ; return add constant class ( class name ) index ; }


rm service contexts which runs through out jvm life span these are created once during start of rm

public r m service context get service context ( ) { return service context ; }


get the next symbol defined or auto after address

private address get next symbol location ( program program , address address ) { symbol iterator sym iter = program get symbol table ( ) get symbol iterator ( address add ( 1 ) , true ) ; if ( sym iter has next ( ) ) { symbol next sym = sym iter next ( ) ; if ( next sym ! = null ) { return next sym get address ( ) ; } } return program get max address ( ) ; }


< code > optional int 3 2 blah = 1 ; < code >

public int get blah ( ) { return blah ; }


verifies that if apple binary a depends on a dylib b1 which then depends on a dylib b2 , that the symbols from b2 are not present in a

public void check avoid deps through dylib ( rule type rule type ) throws exception { rule type scratch target ( scratch , " deps " , " [ ' / / package : objc lib ' ] " , " dylibs " , " [ ' / / package : dylib 1 ' ] " ) ; scratch framework starlark stub ( " frameworkstub / framework stub bzl " ) ; scratch file ( " package / build " , " load ( ' / / frameworkstub : framework stub bzl ' , ' framework stub rule ' ) " , " objc library ( name = ' objc lib ' , srcs = [ ' objc lib m ' ] , " , " deps = [ ' : dylib 1 lib ' , ' : dylib 2 lib ' ] ) " , " objc library ( name = ' dylib 1 lib ' , srcs = [ ' dylib 1 lib m ' ] ) " , " objc library ( name = ' dylib 2 lib ' , srcs = [ ' dylib 2 lib m ' ] ) " , " framework stub rule ( name = ' dylib 1 ' , binary = ' : dylib 1 binary ' ) " , " apple binary ( name = ' dylib 1 binary ' , binary type = ' dylib ' , " , " platform type = ' ios ' , " , " deps = [ ' : dylib 1 lib ' ] , dylibs = [ ' / / package : dylib 2 ' ] ) " , " framework stub rule ( name = ' dylib 2 ' , binary = ' : dylib 2 binary ' ) " , " apple binary ( name = ' dylib 2 binary ' , binary type = ' dylib ' , " , " platform type = ' ios ' , " , " deps = [ ' : dylib 2 lib ' ] ) " , " apple binary ( name = ' alternate ' , " , " platform type = ' ios ' , " , " deps = [ ' / / package : objc lib ' ] ) " ) ; action lipobin action = lipo bin action ( " / / x : x " ) ; artifact bin artifact = get first artifact ending with ( lipobin action get inputs ( ) , " x / x bin " ) ; action link action = get generating action ( bin artifact ) ; assert that ( get first artifact ending with ( link action get inputs ( ) , " package / lib objc lib a " ) ) is not null ( ) ; assert that ( get first artifact ending with ( link action get inputs ( ) , " package / lib dylib 1 lib a " ) ) is null ( ) ; assert that ( get first artifact ending with ( link action get inputs ( ) , " package / lib dylib 2 lib a " ) ) is null ( ) ; / / check that the identical binary without dylibs would be fully linked action alternate lipobin action = lipo bin action ( " / / package : alternate " ) ; artifact alternate bin artifact = get first artifact ending with ( alternate lipobin action get inputs ( ) , " package / alternate bin " ) ; action alternate link action = get generating action ( alternate bin artifact ) ; assert that ( get first artifact ending with ( alternate link action get inputs ( ) , " package / lib objc lib a " ) ) is not null ( ) ; assert that ( get first artifact ending with ( alternate link action get inputs ( ) , " package / lib dylib 1 lib a " ) ) is not null ( ) ; assert that ( get first artifact ending with ( alternate link action get inputs ( ) , " package / lib dylib 2 lib a " ) ) is not null ( ) ; }


each value of the attributes table must be an attribute structure a method can have any number of optional attributes associated with it the attributes defined by this specification as appearing in the attributes table of a method info structure are the code , exceptions , synthetic , signature , deprecated , runtime visible annotations , runtime invisible annotations , runtime visible parameter annotations , runtime invisible parameter annotations , annotation default attributes a java virtual machine implementation must recognize and correctly read code and exceptions attributes found in the attributes table of a method info structure if a java virtual machine implementation recognizes class files whose version number is 49 0 or above , it must recognize and correctly read signature , runtime visible annotations , runtime invisible annotations , runtime visible parameter annotations , runtime invisible parameter annotations , and annotation default attributes found in the attributes table of a method info structure of a class file whose version number is 49 0 or above a java virtual machine implementation is required to silently ignore any or all attributes in the attributes table of a method info structure that it does not recognize attributes not defined in this specification are not allowed to affect the semantics of the class file , but only to provide additional descriptive information

public abstract attribute info [ ] get attributes ( ) { return attributes ; }


protected authentication result get access token from user credentials ( final string username , final string password ) throws exception { var service = ( executor service ) null ; try { service = executors new fixed thread pool ( 1 ) ; val context = new authentication context ( this login url , false , service ) ; logger debug ( " acquiring token for resource [ { } ] and client id [ { } ] for user [ { } ] " , this resource , this client id , username ) ; val future = context acquire token ( this resource , this client id , username , password , null ) ; return future get ( ) ; } finally { if ( service ! = null ) { service shutdown ( ) ; } } }


if the length of the content is unknown , { @ link http content encoder } should not skip encoding the content even if the actual length is turned out to be 0

public void test empty split content ( ) throws exception { embedded channel ch = new embedded channel ( new http content compressor ( ) ) ; ch write inbound ( new request ( ) ) ; ch write outbound ( new default http response ( http version http 1 1 , http response status ok ) ) ; assert encoded response ( ch ) ; ch write outbound ( last http content empty last content ) ; http content chunk = ch read outbound ( ) ; assert that ( byte buf util hex dump ( chunk content ( ) ) , is ( " 1f 8b 0 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 " ) ) ; assert that ( chunk , is ( instance of ( http content class ) ) ) ; chunk release ( ) ; chunk = ch read outbound ( ) ; assert that ( chunk content ( ) is readable ( ) , is ( false ) ) ; assert that ( chunk , is ( instance of ( last http content class ) ) ) ; chunk release ( ) ; assert that ( ch read outbound ( ) , is ( null value ( ) ) ) ; }


returns the target kind of the given target , for example { @ code cc library rule }

public abstract string get target kind ( t target ) ;


override the default jackson smile { @ code decoder } note that { @ link # max in memory size ( int ) } , if configured , will be applied to the given decoder

void jackson 2 smile decoder ( decoder < ? > decoder ) ;


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

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


void input opt ( configuration conf , string key , string val ) { conf set ( m r job config input file option prefix + key , val ) ; }


sets the aliases that will be associated with the index when it gets created

public create index request aliases ( map < string , ? > source ) { try { x content builder builder = x content factory json builder ( ) ; builder map ( source ) ; return aliases ( bytes reference bytes ( builder ) ) ; } catch ( i o exception e ) { throw new elasticsearch generation exception ( " failed to generate [ " + source + " ] " , e ) ; } }


test file context a p is when symlinks are not supported todo : open separate jira for full support of the symlink in webhdfs

public void test unsupported symlink ( ) throws i o exception {


public list < failed node exception > failures ( ) { return failures ; }


whether we should advertise this block as cached to the name node and clients

public boolean should advertise ( ) { return ( this = = cached ) ; }


asks the factory whether an expression is recognized

private boolean is expression ( string expression name ) { return expression factory get expression factory ( ) is expression ( expression name ) ; }


get the number of large file system read operations such as list files under a large directory

public int get large read ops ( ) { return visit all ( new statistics aggregator < integer > ( ) { private int large read ops = 0 ; @ override public void accept ( statistics data data ) { large read ops + = data large read ops ; } public integer aggregate ( ) { return large read ops ; } } ) ; }


retrieves a map of { @ link path } s to the { @ link mapper } class that should be used for them

static map < path , class < ? extends mapper > > get mapper type map ( job conf conf ) { if ( conf get ( " mapreduce input multipleinputs dir mappers " ) = = null ) { return collections empty map ( ) ; } map < path , class < ? extends mapper > > m = new hash map < path , class < ? extends mapper > > ( ) ; string [ ] path mappings = conf get ( " mapreduce input multipleinputs dir mappers " ) split ( " , " ) ; for ( string path mapping : path mappings ) { string [ ] split = path mapping split ( " ; " ) ; class < ? extends mapper > map class ; try { map class = ( class < ? extends mapper > ) conf get class by name ( split [ 1 ] ) ; } catch ( class not found exception e ) { throw new runtime exception ( e ) ; } m put ( new path ( split [ 0 ] ) , map class ) ; } return m ; }


remove the registration of the { @ link application events } for the current thread

static void unregister application events ( ) { application events remove ( ) ; }


finds the inner - most { @ link searchable model object } in scope

public static string get search u r l ( ) { list list = stapler get current request ( ) get ancestors ( ) ; for ( int i = list size ( ) - 1 ; i > = 0 ; i - - ) { ancestor anc = ( ancestor ) list get ( i ) ; if ( anc get object ( ) instanceof searchable model object ) return anc get url ( ) + " / search / " ; } return null ; }


makes sure the current output stream is set up for the given entry

private boolean prepare entry ( data entry data entry ) throws i o exception { / / get the parent stream , new or existing / / this may finish our own jar output stream output stream parent output stream = data entry writer get output stream ( data entry get parent ( ) , this ) ; / / did we get a stream ? if ( parent output stream = = null ) { return false ; } / / do we need a new stream ? if ( current parent output stream = = null ) { current parent output stream = parent output stream ; / / create a new jar stream , with a manifest , if set current jar output stream = manifest ! = null ? new jar output stream ( parent output stream , manifest ) : new zip output stream ( parent output stream ) ; / / add a comment , if set if ( comment ! = null ) { current jar output stream set comment ( comment ) ; } } return true ; }


returns a base 6 4 encoded version of a version 4 0 compatible uuid as defined here : http : www ietf orgrfcrfc 4 1 2 2 txt

public string get base 6 4 u u i d ( ) { return get base 6 4 u u i d ( secure random holder instance ) ; }


this test ensures the { @ link error type # unrecognized assoc option } warning is produced as described in the documentation

@ test public void test unrecognized assoc option ( ) { string grammar = " grammar a ; \ n " + " x : ' x ' \ n " + " | x ' + ' < assoc = right > x / / warning 157 \ n " + " | < assoc = right > x ' * ' x / / ok \ n " + " ; \ n " ; string expected = " warning ( " + error type unrecognized assoc option code + " ) : a g 4 : 3 : 10 : rule x contains an assoc terminal option in an unrecognized location \ n " ; string [ ] pair = new string [ ] { grammar , expected } ; super test errors ( pair , true ) ; }


public void clear inbound rules ( ) { transport ( ) clear inbound behaviors ( ) ; }


constructs a new , empty bimap with the specified expected size

public static < k , v > hash bi map < k , v > create ( int expected size ) { return new hash bi map < > ( expected size ) ; }


public integer get integer ( ) { return integer ; }


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

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


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


returns the current absolute start index

public final int get first index ( ) { return absolute first index ; }


create a new { @ link category context mapping }

public static category context mapping builder category ( string name ) { return new category context mapping builder ( name ) ; }


partition queue user metrics computes metrics at partition ( node label ) queue user level sample jmx op structure : partition queue metrics ( label x ) queue metrics ( a ) usermetrics queue metrics ( a1 ) usermetrics queue metrics ( a2 ) usermetrics queue metrics ( b ) usermetrics

public synchronized queue metrics get user metrics ( string user name ) { if ( users = = null ) { return null ; } string partition j m x str = ( partition equals ( default partition ) ) ? default partition jmx str : partition ; queue metrics metrics = ( partition queue metrics ) users get ( user name ) ; if ( metrics = = null ) { metrics = new partition queue metrics ( this metrics system , this queue name , null , false , this conf , this partition ) ; users put ( user name , metrics ) ; metrics system register ( p source name ( partition j m x str ) append ( q source name ( queue name ) ) append ( " , user = " ) append ( user name ) to string ( ) , " metrics for user ' " + user name + " ' in queue ' " + queue name + " ' " , ( ( partition queue metrics ) metrics tag ( partition info , partition j m x str ) tag ( queue info , queue name ) ) tag ( user info , user name ) ) ; } return metrics ; }


adds a symbol with the indicated name at the specified address and makes it primary

private void add primary symbol ( program program , string address string , string symbol name ) throws duplicate name exception , invalid input exception { address address = addr ( address string , program ) ; int tx i d = program start transaction ( " add primary symbol " ) ; boolean commit = false ; try { symbol table symbol table = program get symbol table ( ) ; symbol symbol = symbol table create label ( address , symbol name , source type user defined ) ; set label primary cmd set label primary cmd = new set label primary cmd ( address , symbol get name ( ) , symbol get parent namespace ( ) ) ; vt test env get tool ( ) execute ( set label primary cmd , program ) ; commit = true ; } finally { program end transaction ( tx i d , commit ) ; } }


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


attempts to load an existing data object from disk { @ link keyed data storage } class serializes the requests so that no two threads call the { @ link # load ( string ) } method with the same parameter concurrently this ensures that there ' s only up to one data object for any key

protected abstract @ check for null t load ( string key ) throws i o exception ;


builds suggestions for an unknown field , returning an empty string if there aren ' t any suggestions or " did you mean " and then the list of suggestions

public static string suggest ( string unknown field , iterable < string > candidates ) { / / todo it ' d be nice to combine this with base rest handler ' s implementation levenshtein distance ld = new levenshtein distance ( ) ; final list < tuple < float , string > > scored = new array list < > ( ) ; for ( string candidate : candidates ) { float distance = ld get distance ( unknown field , candidate ) ; if ( distance > 0 5f ) { scored add ( new tuple < > ( distance , candidate ) ) ; } } if ( scored is empty ( ) ) { return " " ; } collection util tim sort ( scored , ( a , b ) - > { / / sort by distance in reverse order , then parameter name for equal distances int compare = a v 1 ( ) compare to ( b v 1 ( ) ) ; if ( compare ! = 0 ) { return - compare ; } return a v 2 ( ) compare to ( b v 2 ( ) ) ; } ) ; list < string > keys = scored stream ( ) map ( tuple : : v 2 ) collect ( to list ( ) ) ; string builder builder = new string builder ( " did you mean " ) ; if ( keys size ( ) = = 1 ) { builder append ( " [ " ) append ( keys get ( 0 ) ) append ( " ] " ) ; } else { builder append ( " any of " ) append ( keys to string ( ) ) ; } builder append ( " ? " ) ; return builder to string ( ) ; }


returns the count of the statistic using the specified time value as the current time

final long get ( long now ) { long interval end = get slot end time ( now ) ; long interval start = interval end - interval ; / / this is the point at which increments to new slots will be ignored int index = current index ; long accumulated = 0l ; long prev slot end = long max value ; for ( int i = 0 ; i < num slots ; i + + ) { if ( index < 0 ) { index = num slots - 1 ; } slot current slot = slots get ( index ) ; index - - ; long current slot end = current slot end nanos ; if ( current slot end < = interval start | | current slot end > prev slot end ) { break ; } prev slot end = current slot end ; if ( current slot end > interval end ) { continue ; } accumulated = accumulated + current slot count ; } return accumulated ; }