private void iterate records ( boolean test stored d b , int schema type , int record cnt , long key increment , int var data size , boolean do undo redo ) throws i o exception { d b record [ ] recs = null ; if ( key increment = = 0 ) { recs = create random table records ( schema type , record cnt , var data size ) ; } else { recs = create ordered table records ( schema type , record cnt , key increment , var data size ) ; } if ( test stored d b ) { save as and reopen ( db name ) ; } table table = dbh get table ( table 1 name ) ; assert equals ( record cnt , table get record count ( ) ) ; if ( do undo redo ) { dbh undo ( ) ; dbh redo ( ) ; table = dbh get table ( table 1 name ) ; assert equals ( record cnt , table get record count ( ) ) ; } for ( int col ix : table get indexed columns ( ) ) { arrays sort ( recs , new rec column comparator ( col ix ) ) ; int rec ix ; record iterator iter ; array list < field > index fields = new array list < > ( ) ; / / list of unique index field values / / forward iteration ( default iterator with no start ) - also collect unique fields field last index = null ; rec ix = 0 ; iter = table index iterator ( col ix ) ; while ( iter has next ( ) ) { d b record rec = iter next ( ) ; assert equals ( recs [ rec ix ] , rec ) ; field index field = recs [ rec ix ] get field ( col ix ) ; if ( last index = = null | | ! last index equals ( index field ) ) { index fields add ( index field ) ; last index = index field ; } + + rec ix ; } assert equals ( record cnt , rec ix ) ; / / backward iteration ( default iterator with no start ) rec ix = 0 ; iter = table index iterator ( col ix ) ; assert true ( ! iter has previous ( ) ) ; / / forward iteration ( after end ) iter = table index iterator after ( col ix , recs [ record cnt - 1 ] get field ( col ix ) ) ; assert true ( ! iter has next ( ) ) ; / / backward iteration ( before first ) rec ix = 0 ; iter = table index iterator before ( col ix , recs [ rec ix ] get field ( col ix ) ) ; assert true ( ! iter has previous ( ) ) ; / / backward iteration ( after first ) int start ix = 0 ; rec ix = find end ( recs , start ix , col ix ) ; iter = table index iterator after ( col ix , recs [ start ix ] get field ( col ix ) ) ; while ( iter has previous ( ) ) { d b record rec = iter previous ( ) ; assert equals ( recs [ rec ix - - ] , rec ) ; } assert equals ( - 1 , rec ix ) ; assert true ( ! iter has previous ( ) ) ; / / forward iteration ( before first - specify primary key ) start ix = 0 ; rec ix = find start ( recs , start ix , col ix ) ; iter = table index iterator before ( col ix , recs [ start ix ] get field ( col ix ) , recs [ start ix ] get key field ( ) ) ; while ( iter has next ( ) ) { d b record rec = iter next ( ) ; assert equals ( recs [ rec ix + + ] , rec ) ; } assert equals ( record cnt , rec ix ) ; / / backward iteration ( before first - specify primary key ) start ix = 0 ; rec ix = find start ( recs , start ix , col ix ) ; iter = table index iterator before ( col ix , recs [ start ix ] get field ( col ix ) , recs [ start ix ] get key field ( ) ) ; assert true ( ! iter has previous ( ) ) ; / / forward iteration ( before first ) rec ix = 0 ; iter = table index iterator before ( col ix , recs [ rec ix ] get field ( col ix ) ) ; while ( iter has next ( ) ) { d b record rec = iter next ( ) ; assert equals ( recs [ rec ix + + ] , rec ) ; } assert equals ( record cnt , rec ix ) ; / / backward iteration ( before first ) rec ix = 0 ; iter = table index iterator before ( col ix , recs [ rec ix ] get field ( col ix ) ) ; assert true ( ! iter has previous ( ) ) ; / / forward iteration ( end - specify primary key ) rec ix = record cnt - 1 ; iter = table index iterator after ( col ix , recs [ rec ix ] get field ( col ix ) , recs [ rec ix ] get key field ( ) ) ; assert true ( ! iter has next ( ) ) ; / / backward iteration ( end - specify primary key ) rec ix = record cnt - 1 ; iter = table index iterator after ( col ix , recs [ rec ix ] get field ( col ix ) , recs [ rec ix ] get key field ( ) ) ; while ( iter has previous ( ) ) { d b record rec = iter previous ( ) ; assert equals ( recs [ rec ix - - ] , rec ) ; } assert equals ( - 1 , rec ix ) ; / / forward iteration ( end ) rec ix = record cnt - 1 ; iter = table index iterator after ( col ix , recs [ rec ix ] get field ( col ix ) ) ; assert true ( ! iter has next ( ) ) ; / / backward iteration ( end ) rec ix = record cnt - 1 ; iter = table index iterator after ( col ix , recs [ rec ix ] get field ( col ix ) ) ; while ( iter has previous ( ) ) { d b record rec = iter previous ( ) ; assert equals ( recs [ rec ix - - ] , rec ) ; } assert equals ( - 1 , rec ix ) ; / / forward iteration ( start in middle - specify primary key ) rec ix = record cnt / 2 ; iter = table index iterator before ( col ix , recs [ rec ix ] get field ( col ix ) , recs [ rec ix ] get key field ( ) ) ; while ( iter has next ( ) ) { d b record rec = iter next ( ) ; assert equals ( recs [ rec ix + + ] , rec ) ; } assert equals ( record cnt , rec ix ) ; / / backward iteration ( start in middle - specify primary key ) rec ix = record cnt / 2 ; iter = table index iterator after ( col ix , recs [ rec ix ] get field ( col ix ) , recs [ rec ix ] get key field ( ) ) ; while ( iter has previous ( ) ) { d b record rec = iter previous ( ) ; assert equals ( recs [ rec ix - - ] , rec ) ; } assert equals ( - 1 , rec ix ) ; / / forward iteration ( from start in middle ) rec ix = find start ( recs , record cnt / 2 , col ix ) ; iter = table index iterator before ( col ix , recs [ rec ix ] get field ( col ix ) ) ; while ( iter has next ( ) ) { d b record rec = iter next ( ) ; assert equals ( recs [ rec ix + + ] , rec ) ; } assert equals ( record cnt , rec ix ) ; / / backward iteration ( from start in middle ) rec ix = find start ( recs , record cnt / 2 , col ix ) ; iter = table index iterator before ( col ix , recs [ rec ix ] get field ( col ix ) ) ; while ( iter has previous ( ) ) { d b record rec = iter previous ( ) ; assert equals ( recs [ - - rec ix ] , rec ) ; } assert equals ( 0 , rec ix ) ; / / forward iteration ( from end in middle ) rec ix = find end ( recs , record cnt / 2 , col ix ) ; iter = table index iterator after ( col ix , recs [ rec ix ] get field ( col ix ) ) ; while ( iter has next ( ) ) { d b record rec = iter next ( ) ; assert equals ( recs [ + + rec ix ] , rec ) ; } assert equals ( record cnt - 1 , rec ix ) ; / / reverse iteration ( from end in middle ) rec ix = find end ( recs , record cnt / 2 , col ix ) ; iter = table index iterator after ( col ix , recs [ rec ix ] get field ( col ix ) ) ; while ( iter has previous ( ) ) { d b record rec = iter previous ( ) ; assert equals ( recs [ rec ix - - ] , rec ) ; } assert equals ( - 1 , rec ix ) ; / / forward range iterator int min ix = find start ( recs , record cnt / 10 , col ix ) ; int max ix = find end ( recs , record cnt / 5 , col ix ) ; rec ix = min ix ; iter = table index iterator ( col ix , recs [ min ix ] get field ( col ix ) , recs [ max ix ] get field ( col ix ) , true ) ; while ( iter has next ( ) ) { d b record rec = iter next ( ) ; assert equals ( recs [ rec ix + + ] , rec ) ; } assert equals ( max ix + 1 , rec ix ) ; / / full forward record iterator rec ix = 0 ; iter = table index iterator ( col ix , null , null , true ) ; while ( iter has next ( ) ) { d b record rec = iter next ( ) ; assert equals ( recs [ rec ix + + ] , rec ) ; } assert equals ( record cnt , rec ix ) ; / / backward range iterator min ix = find start ( recs , record cnt / 10 , col ix ) ; max ix = find end ( recs , record cnt / 5 , col ix ) ; rec ix = max ix ; iter = table index iterator ( col ix , recs [ min ix ] get field ( col ix ) , recs [ max ix ] get field ( col ix ) , false ) ; while ( iter has previous ( ) ) { d b record rec = iter previous ( ) ; assert equals ( recs [ rec ix - - ] , rec ) ; } assert equals ( min ix - 1 , rec ix ) ; / / full reverse record iterator rec ix = record cnt - 1 ; iter = table index iterator ( col ix , null , null , false ) ; while ( iter has previous ( ) ) { d b record rec = iter previous ( ) ; assert equals ( recs [ rec ix - - ] , rec ) ; } assert equals ( - 1 , rec ix ) ; if ( recs [ 0 ] get field ( col ix ) instanceof long field ) { / / forward iteration ( after end ) long k = recs [ record cnt - 1 ] get field ( col ix ) get long value ( ) + 1 ; iter = table index iterator before ( col ix , new long field ( k ) ) ; assert true ( ! iter has next ( ) ) ; / / forward iteration ( start in middle - specify primary key ) rec ix = find start ( recs , record cnt / 2 , col ix ) ; field start value = new long field ( ) ; start value set long value ( recs [ rec ix ] get field ( col ix ) get long value ( ) - 1 ) ; iter = table index iterator after ( col ix , start value ) ; while ( iter has next ( ) ) { d b record rec = iter next ( ) ; assert equals ( recs [ rec ix + + ] , rec ) ; } assert equals ( record cnt , rec ix ) ; / / backward iteration ( start in middle ) rec ix = find end ( recs , record cnt / 2 , col ix ) ; start value set long value ( recs [ rec ix ] get field ( col ix ) get long value ( ) + 1 ) ; iter = table index iterator before ( col ix , start value ) ; while ( iter has previous ( ) ) { d b record rec = iter previous ( ) ; assert equals ( recs [ rec ix - - ] , rec ) ; } assert equals ( - 1 , rec ix ) ; } /


returns a string containing the string representation of each entry in { @ code entries } , using the previously configured separator and key - value separator

public string join ( iterator < ? extends entry < ? , ? > > entries ) { return append to ( new string builder ( ) , entries ) to string ( ) ; }


an unused property this method will always return { @ code 0 }


public revert model snapshot response revert model snapshot ( revert model snapshot request request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( request , m l request converters : : revert model snapshot , options , revert model snapshot response : : from x content , collections empty set ( ) ) ; }


create a { @ link consumer record } with default topic name and given key , value , and timestamp does not auto advance internally tracked time

public consumer record < byte [ ] , byte [ ] > create ( final k key , final v value , final long timestamp ms ) { return create ( key , value , new record headers ( ) , timestamp ms ) ; }


public void confirmed ( ) { if ( loader get file name ( ) = = null | | loader get file name ( ) equals ( " " ) ) { view show message ( " please give the name of the file first ! " ) ; return ; } if ( loader file exists ( ) ) { var data = loader load data ( ) ; view display data ( data ) ; } else { view show message ( " the file specified does not exist " ) ; } }


public final boolean read boolean ( ) throws i o exception { return dis read boolean ( ) ; }


creates a bitmap of the specified width and height

public closeable reference < bitmap > create bitmap internal ( int width , int height , bitmap config bitmap config ) { int size in bytes = bitmap util get size in byte for bitmap ( width , height , bitmap config ) ; bitmap bitmap = m bitmap pool get ( size in bytes ) ; preconditions check argument ( bitmap get allocation byte count ( ) > = width * height * bitmap util get pixel size for bitmap config ( bitmap config ) ) ; bitmap reconfigure ( width , height , bitmap config ) ; return m closeable reference factory create ( bitmap , m bitmap pool ) ; }


return the class loader that the application ' s beans are loaded with proxies will be generated in this class loader

class loader get bean class loader ( ) ;


this implementation returns the hash code of the underlying class path location

public int hash code ( ) { return this path hash code ( ) ; }


it ' s ok to track a duration against an unknown statistic

public void test unknown duration ( ) throws throwable { track duration of callable ( stats , unknown , ( ) - > sleepf ( 1 ) ) call ( ) ; duration statistic summary summary = fetch success summary ( stats , unknown ) ; assert summary values ( summary , 0 , - 1 , - 1 ) ; assert that ( summary get mean ( ) ) is null ( ) ; }


returns a string representation of this object

public string to string ( ) { return " a record version mismatch occurred expecting v " + expected version + " , found v " + found version ; }


register a new { @ link jms listener endpoint } alongside the { @ link jms listener container factory } to use to create the underlying container the { @ code factory } may be { @ code null } if the default factory has to be used for that endpoint

public void register endpoint ( jms listener endpoint endpoint , @ nullable jms listener container factory < ? > factory ) { assert not null ( endpoint , " endpoint must not be null " ) ; assert has text ( endpoint get id ( ) , " endpoint id must be set " ) ; / / factory may be null , we defer the resolution right before actually creating the container jms listener endpoint descriptor descriptor = new jms listener endpoint descriptor ( endpoint , factory ) ; synchronized ( this mutex ) { if ( this start immediately ) { / / register and start immediately assert state ( this endpoint registry ! = null , " no jms listener endpoint registry set " ) ; this endpoint registry register listener container ( descriptor endpoint , resolve container factory ( descriptor ) , true ) ; } else { this endpoint descriptors add ( descriptor ) ; } } }


start a mini - cluster , and set up everything the tests need to use it

private void init cluster ( ) throws exception { cluster = new mini d f s cluster builder ( conf ) num data nodes ( 1 ) build ( ) ; cluster wait active ( ) ; dn = cluster get data nodes ( ) get ( 0 ) ; bpos = dn get all bp os ( ) get ( 0 ) ; nn proxy = bpos get active n n ( ) ; bp registration = bpos bp registration ; bp id = bpos get block pool id ( ) ; dn storage = dn get f s dataset ( ) get block reports ( bp id ) key set ( ) iterator ( ) next ( ) ; }


set the configuration source { @ code object } for this metadata element the exact type of the object will depend on the configuration mechanism used

public void set source ( @ nullable object source ) { this source = source ; }


finds the highest position < code > p < code > in < code > f document < code > such that < code > bound < code > & lt ; < code > p < code > & lt ; = < code > start < code > and < code > condition stop ( f document get char ( p ) , p ) < code > evaluates to < code > true < code >

public int scan backward ( int start , int bound , stop condition condition ) { if ( bound = = unbound ) { bound = - 1 ; } assert ( bound > = - 1 ) ; assert ( start < document get length ( ) ) ; try { last pos = start ; while ( last pos > bound ) { last char = document get char ( last pos ) ; if ( condition stop ( last char , last pos , false ) ) { return last pos ; } last pos - - ; } } catch ( bad location exception e ) { / / log debug ( editor messages error bad location exception , e ) ; } return not found ; }


return an instance of the given class to be used as an argument passed to one method call if one method has multiple arguments with the same type , each occurrence will call this method once it is recommended that each invocation returns a distinctive object for the same type , in order to verify that arguments are passed by the tested class correctly

@ nullable object get ( method method , int arg pos , class < ? > clazz ) ;


return a < a href = " https : en wikipedia orgwiki hex dump " > hex dump of the line separator in utf - 8 encoding

public string to string ( ) { return byte buf util hex dump ( value get bytes ( charset util utf 8 ) ) ; }


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

public string select header content type ( string [ ] content types ) { if ( content types length = = 0 | | content types [ 0 ] equals ( " * / * " ) ) { return " application / json " ; } for ( string content type : content types ) { if ( is json mime ( content type ) ) { return content type ; } } return content types [ 0 ] ; }


test the property ' prefix namespace number '

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


public boolean equals identity ( object o ) { if ( this = = o ) return true ; if ( o = = null | | ! ( o instanceof queue ) ) return false ; queue < ? > q = ( queue < ? > ) o ; final int size = this size ; if ( q size ! = size ) return false ; final t [ ] my values = this values ; final int my backing length = my values length ; final object [ ] its values = q values ; final int its backing length = its values length ; int my index = head ; int its index = q head ; for ( int s = 0 ; s < size ; s + + ) { if ( my values [ my index ] ! = its values [ its index ] ) return false ; my index + + ; its index + + ; if ( my index = = my backing length ) my index = 0 ; if ( its index = = its backing length ) its index = 0 ; } return true ; }


public float get restitution ( ) { return fixture get restitution ( ) ; }


add and get adds given value to current , and returns current value

public void test add and get ( ) { atomic double array aa = new atomic double array ( size ) ; for ( int i : new int [ ] { 0 , size - 1 } ) { for ( double x : values ) { for ( double y : values ) { aa set ( i , x ) ; double z = aa add and get ( i , y ) ; assert bit equals ( x + y , z ) ; assert bit equals ( x + y , aa get ( i ) ) ; } } } }


get a mock { @ link r m context } for use in test cases

public static r m context get mock r m context ( ) { / / null dispatcher dispatcher null dispatcher = new dispatcher ( ) { private final event handler handler = new event handler ( ) { @ override public void handle ( event event ) { } } ; @ override public void register ( class < ? extends enum > event type , event handler handler ) { } @ override public event handler < event > get event handler ( ) { return handler ; } } ; / / no op container allocation expirer cae = new container allocation expirer ( null dispatcher ) ; configuration conf = new configuration ( ) ; r m application history writer writer = mock ( r m application history writer class ) ; r m context impl rm context = new r m context impl ( null dispatcher , cae , null , null , null , new a m r m token secret manager ( conf , null ) , new r m container token secret manager ( conf ) , new n m token secret manager in r m ( conf ) , new client to a m token secret manager in r m ( ) ) ; r m node labels manager nlm = mock ( r m node labels manager class ) ; when ( nlm get queue resource ( any ( string class ) , any ( set class ) , any ( resource class ) ) ) then answer ( new answer < resource > ( ) { @ override public resource answer ( invocation on mock invocation ) throws throwable { object [ ] args = invocation get arguments ( ) ; return ( resource ) args [ 2 ] ; } } ) ; when ( nlm get resource by label ( any ( ) , any ( resource class ) ) ) then answer ( new answer < resource > ( ) { @ override public resource answer ( invocation on mock invocation ) throws throwable { object [ ] args = invocation get arguments ( ) ; return ( resource ) args [ 1 ] ; } } ) ; rm context set yarn configuration ( conf ) ; rm context set node label manager ( nlm ) ; rm context set system metrics publisher ( mock ( system metrics publisher class ) ) ; rm context set r m application history writer ( mock ( r m application history writer class ) ) ; resource scheduler mock scheduler = mock ( resource scheduler class ) ; when ( mock scheduler get resource calculator ( ) ) then return ( new default resource calculator ( ) ) ; rm context set scheduler ( mock scheduler ) ; allocation tags manager ptm = mock ( allocation tags manager class ) ; rm context set allocation tags manager ( ptm ) ; return rm context ; }


returns a set of all edges that are reachable from the given vertex

public static < v , e extends g edge < v > > set < e > get edges from ( g directed graph < v , e > g , v v , boolean top down ) { list < v > list = arrays as list ( v ) ; set < e > edges = get edges from ( g , list , top down ) ; return edges ; }


this method is deprecated and will be removed in the future releases handle async db operation in your own logic instead

public static < t > find executor < t > find last async ( final class < t > model class , final boolean is eager ) { final find executor < t > executor = new find executor < > ( ) ; runnable runnable = new runnable ( ) { @ override public void run ( ) { synchronized ( lite pal support class ) { final t t = find last ( model class , is eager ) ; if ( executor get listener ( ) ! = null ) { operator get handler ( ) post ( new runnable ( ) { @ override public void run ( ) { executor get listener ( ) on finish ( t ) ; } } ) ; } } } } ; executor submit ( runnable ) ; return executor ; }


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

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


public static activator get default ( ) { return plugin ; }


writes data to a page blob of the given size , flushing every x bytes measure performance of that and return it

private static test result write page blob test file ( native azure file system fs , long size , long flush interval ) throws i o exception { path test file = azure test utils blob path for tests ( fs , " write page blob test file " ) ; return write test file ( fs , test file , size , flush interval ) ; }


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


is called when image loading task was cancelled because view for image was reused in newer task

void on loading cancelled ( string image uri , view view ) ;


generates { @ link vertex vertices } with sequential , numerical labels

public static data set < vertex < long value , null value > > vertex sequence ( execution environment env , int parallelism , long vertex count ) { preconditions check argument ( vertex count > = 0 , " vertex count must be non - negative " ) ; if ( vertex count = = 0 ) { return env from collection ( collections empty list ( ) , type information of ( new type hint < vertex < long value , null value > > ( ) { } ) ) set parallelism ( parallelism ) name ( " empty vertex set " ) ; } else { long value sequence iterator iterator = new long value sequence iterator ( 0 , vertex count - 1 ) ; data source < long value > vertex labels = env from parallel collection ( iterator , long value class ) set parallelism ( parallelism ) name ( " vertex indices " ) ; return vertex labels map ( new create vertex ( ) ) set parallelism ( parallelism ) name ( " vertex sequence " ) ; } }


serializes an object into a byte array along with { @ link # read ( byte [ ] ) } , can be used to serialize an object and deserialize it into an object of the same type without needing to specify the object ' s type , as long as it is one of the json - compatible objects understood by object mapper

public static byte [ ] write ( object o ) throws i o exception { if ( o = = null ) { return empty bytes ; } return object writer write value as bytes ( o ) ; }


returns an immutable copy of { @ code graph }

public static < n > immutable graph < n > copy of ( graph < n > graph ) { return ( graph instanceof immutable graph ) ? ( immutable graph < n > ) graph : new immutable graph < n > ( new standard value graph < n , presence > ( graph builder from ( graph ) , get node connections ( graph ) , graph edges ( ) size ( ) ) ) ; }


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


represents a double value as either " na " if it is na n , or as a percentage with " % 2f % % "

public static string pretty percentage ( double relative value ) { if ( double is na n ( relative value ) ) { return " n / a " ; } return string format ( " % 2f % % " , relative value * 100 ) ; }


public long get begin time ( ) { return begin time ; }


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


sets an experimental option useful for new opera driver options not yet exposed through the { @ link opera options } api

public opera options set experimental option ( string name , object value ) { experimental options put ( require non null ( " option name " , name ) , value ) ; return this ; }


ensure that labels from binary targets expand to the executable

public void test binary targets expand to executable ( ) throws exception { scratch file ( " genrule 3 / build " , " genrule ( name = ' hello world ' , " , " srcs = [ ' ignore me txt ' ] , " , " tools = [ ' echo ' ] , " , " outs = [ ' message txt ' ] , " , " cmd = ' $ ( location : echo ) \ " hello , world \ " > message txt ' ) " , " cc binary ( name = ' echo ' , " , " srcs = [ ' echo cc ' ] ) " ) ; string regex = " b { 4 } - out / * / bin / genrule 3 / echo ( \ \ exe ) ? \ " hello , world \ " > message txt " ; assert that ( get command ( " / / genrule 3 : hello world " ) ) contains match ( regex ) ; }


public delete repository request builder set name ( string name ) { request name ( name ) ; return this ; }


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

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


creates an { @ link animated image result builder } for creating an { @ link animated image result }

public static animated image result builder new builder ( animated image image ) { return new animated image result builder ( image ) ; }


this test validates the correctness of get application attempt report in case of empty request

public void test get application attempt empty request ( ) throws exception { log info ( " test federation client interceptor : " + " get application attempt report - empty " ) ; lambda test utils intercept ( yarn exception class , " missing get application attempt report " + " request or application id " + " or application attempt id information " , ( ) - > interceptor get application attempt report ( null ) ) ; lambda test utils intercept ( yarn exception class , " missing get application attempt report " + " request or application id " + " or application attempt id information " , ( ) - > interceptor get application attempt report ( get application attempt report request new instance ( null ) ) ) ; lambda test utils intercept ( yarn exception class , " missing get application attempt report " + " request or application id " + " or application attempt id information " , ( ) - > interceptor get application attempt report ( get application attempt report request new instance ( application attempt id new instance ( null , 1 ) ) ) ) ; }


returns the html documentation of the rule attribute

public string get html documentation ( ) throws build encyclopedia doc exception { string expanded html doc = html documentation ; if ( link expander ! = null ) { try { expanded html doc = link expander expand ( expanded html doc ) ; } catch ( illegal argument exception e ) { throw new build encyclopedia doc exception ( file name , start line cnt , e get message ( ) ) ; } } return expanded html doc ; }


computes the total width , in register - units , of the parameters for this method

static int compute param width ( concrete method meth , boolean is static ) { return meth get effective descriptor ( ) get parameter types ( ) get word count ( ) ; }


return true if this cat all of object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } cat all of cat all of = ( cat all of ) o ; return objects equals ( this declawed , cat all of declawed ) ; }


return a bean factory with attributes and enterprise services configured

protected bean factory get bean factory ( ) throws i o exception { return new class path xml application context ( default context , class ) ; }


creates a new { @ linkplain guard guard } for this monitor

public guard new guard ( final boolean supplier is satisfied ) { check not null ( is satisfied , " is satisfied " ) ; return new guard ( this ) { @ override public boolean is satisfied ( ) { return is satisfied get as boolean ( ) ; } } ; }


returns true if { @ code target } has " manual " in the tags attribute and thus should be ignored by command - line wildcards or by test suite $ implicit tests attribute

public static boolean has manual tag ( target target ) { return ( target instanceof rule ) & & has constraint ( ( rule ) target , " manual " ) ; }


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


publishes the given entities holder and return immediately if sync call , else tries to fetch the entities holder from the queue in non blocking fashion and collate the entities if possible before publishing through rest

private void publish without blocking on queue ( entities holder entities holder ) { if ( entities holder is sync ( ) ) { entities holder run ( ) ; return ; } int count = 1 ; while ( true ) { / / loop till we find a sync put entities or there is nothing / / to take entities holder next entity in the queue = timeline entity queue poll ( ) ; if ( next entity in the queue = = null ) { / / nothing in the queue just publish and get back to the / / blocked wait state entities holder run ( ) ; break ; } else if ( next entity in the queue is sync ( ) ) { / / flush all the prev async entities first entities holder run ( ) ; / / and then flush the sync entity next entity in the queue run ( ) ; break ; } else { / / append all async entities together and then flush entities holder get entities ( ) add entities ( next entity in the queue get entities ( ) get entities ( ) ) ; count + + ; if ( count = = number of asyncs to merge ) { / / flush the entities if the number of the async / / put entites merged reaches the desired limit to avoid / / collecting multiple entities and delaying for a long / / time entities holder run ( ) ; break ; } } } }


see { @ link file status # get block size ( ) }


delete fake : fake endpoint to test group parameters ( optional ) fake endpoint to test group parameters ( optional )

default response entity < void > test group parameters ( @ not null @ api param ( value = " required string in group parameters " , required = true ) @ valid @ request param ( value = " required string group " , required = true ) integer required string group , @ api param ( value = " required boolean in group parameters " , required = true ) @ request header ( value = " required boolean group " , required = true ) boolean required boolean group , @ not null @ api param ( value = " required integer in group parameters " , required = true ) @ valid @ request param ( value = " required int 6 4 group " , required = true ) long required int 6 4 group , @ api param ( value = " string in group parameters " ) @ valid @ request param ( value = " string group " , required = false ) integer string group , @ api param ( value = " boolean in group parameters " ) @ request header ( value = " boolean group " , required = false ) boolean boolean group , @ api param ( value = " integer in group parameters " ) @ valid @ request param ( value = " int 6 4 group " , required = false ) long int 6 4 group ) { return new response entity < > ( http status not implemented ) ; }


get the { @ link test context manager } associated with the supplied test class

static test context manager get test context manager ( class < ? > test class ) { assert not null ( test class , " test class must not be null " ) ; return test context manager cache compute if absent ( test class , test context manager : : new ) ; }


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


when failing over , if rm1 stopped and removed a queue that rm2 has in memory , failing over to rm2 should not throw an exception

public void test failover after remove queue ( ) throws exception { h a service protocol state change request info req = new h a service protocol state change request info ( h a service protocol request source request by user ) ; configuration conf 1 = create r m h a conf ( " rm 1 , rm 2 " , " rm 1 " , 1234 ) ; resource manager rm 1 = new mock r m ( conf 1 ) ; rm 1 start ( ) ; rm 1 get r m context ( ) get r m admin service ( ) transition to active ( req ) ; assert equals ( " rm with z k store didn ' t start " , service state started , rm 1 get service state ( ) ) ; assert equals ( " rm should be active " , h a service protocol h a service state active , rm 1 get r m context ( ) get r m admin service ( ) get service status ( ) get state ( ) ) ; configuration conf 2 = create r m h a conf ( " rm 1 , rm 2 " , " rm 2 " , 5678 ) ; resource manager rm 2 = new mock r m ( conf 2 ) ; rm 2 start ( ) ; assert equals ( " rm should be standby " , h a service protocol h a service state standby , rm 2 get r m context ( ) get r m admin service ( ) get service status ( ) get state ( ) ) ; user group information user = user group information create user for testing ( test user , new string [ 0 ] ) ; mutable configuration provider conf provider = ( ( mutable conf scheduler ) rm 1 get resource scheduler ( ) ) get mutable conf provider ( ) ; / / add root a sched conf update info sched conf update info = new sched conf update info ( ) ; map < string , string > add params = new hash map < > ( ) ; add params put ( " capacity " , " 100 " ) ; queue config info add info = new queue config info ( " root a " , add params ) ; sched conf update info get add queue info ( ) add ( add info ) ; / / stop root default map < string , string > stop params = new hash map < > ( ) ; stop params put ( " state " , " stopped " ) ; stop params put ( " capacity " , " 0 " ) ; queue config info stop info = new queue config info ( " root default " , stop params ) ; sched conf update info get update queue info ( ) add ( stop info ) ; log mutation log = conf provider log and apply mutation ( user , sched conf update info ) ; rm 1 get resource scheduler ( ) reinitialize ( conf 1 , rm 1 get r m context ( ) ) ; conf provider confirm pending mutation ( log , true ) ; assert true ( arrays as list ( ( ( mutable conf scheduler ) rm 1 get resource scheduler ( ) ) get configuration ( ) get ( " yarn scheduler capacity root queues " ) split ( " , " ) ) contains ( " a " ) ) ; / / remove root default sched conf update info get update queue info ( ) clear ( ) ; sched conf update info get add queue info ( ) clear ( ) ; sched conf update info get remove queue info ( ) add ( " root default " ) ; log = conf provider log and apply mutation ( user , sched conf update info ) ; rm 1 get resource scheduler ( ) reinitialize ( conf 1 , rm 1 get r m context ( ) ) ; conf provider confirm pending mutation ( log , true ) ; assert equals ( " a " , ( ( mutable conf scheduler ) rm 1 get resource scheduler ( ) ) get configuration ( ) get ( " yarn scheduler capacity root queues " ) ) ; / / start rm2 and verifies it starts with updated configuration rm 2 get r m context ( ) get r m admin service ( ) transition to active ( req ) ; assert equals ( " rm with z k store didn ' t start " , service state started , rm 2 get service state ( ) ) ; assert equals ( " rm should be active " , h a service protocol h a service state active , rm 2 get r m context ( ) get r m admin service ( ) get service status ( ) get state ( ) ) ; for ( int i = 0 ; i < zk timeout ms / 50 ; i + + ) { if ( h a service protocol h a service state active = = rm 1 get r m context ( ) get r m admin service ( ) get service status ( ) get state ( ) ) { thread sleep ( 100 ) ; } } assert equals ( " rm should have been fenced " , h a service protocol h a service state standby , rm 1 get r m context ( ) get r m admin service ( ) get service status ( ) get state ( ) ) ; assert equals ( " rm should be active " , h a service protocol h a service state active , rm 2 get r m context ( ) get r m admin service ( ) get service status ( ) get state ( ) ) ; assert equals ( " a " , ( ( mutable c s configuration provider ) ( ( capacity scheduler ) rm 2 get resource scheduler ( ) ) get mutable conf provider ( ) ) get conf store ( ) retrieve ( ) get ( " yarn scheduler capacity root queues " ) ) ; assert equals ( " a " , ( ( mutable conf scheduler ) rm 2 get resource scheduler ( ) ) get configuration ( ) get ( " yarn scheduler capacity root queues " ) ) ; / / transition to standby will set rm ' s ha status and then reinitialize in / / a separate thread despite asserting for standby state , it ' s / / possible for reinitialization to be unfinished wait here for it to / / finish , otherwise closing rm 1 will close zk manager and the unfinished / / reinitialization will throw an exception thread sleep ( 10000 ) ; rm 1 close ( ) ; rm 2 close ( ) ; }


returns the hash code for this multimap the hash code of a multimap is defined as the hash code of the map view , as returned by { @ link multimap # as map }

public int hash code ( ) { return as map ( ) hash code ( ) ; }


given a key , returns the index of the entry in the tables , or absent if not found

int find entry by key ( @ nullable decl object key ) { return find entry by key ( key , hashing smeared hash ( key ) ) ; }


test case where a bunch of threads are both appending and flushing they all finish before the file is closed

public void test multiple hflushers repl 1 ( ) throws exception { do test multiple hflushers ( 1 ) ; }


public byte get application flags ( ) { return ne flags app ; }


configure one or more request header names ( e g " accept - language " ) to add to the " vary " response header to inform clients that the response is subject to content negotiation and variances based on the value of the given request headers the configured request header names are added only if not already present in the response " vary " header

builder < t > vary by ( string request headers ) ;


externally muting a channel should be done via selector to ensure proper state handling

void mute ( ) { if ( mute state = = channel mute state not muted ) { if ( ! disconnected ) transport layer remove interest ops ( selection key op read ) ; mute state = channel mute state muted ; } }


add the model to this controller can only be called from inside { @ link epoxy controller # build models ( ) }

public void add ( @ non null epoxy model < ? > model ) { model add to ( this ) ; }


whether named parameters enabled or disabled in prepared s q ls

public boolean get named parameters enabled ( ) { return this named parameters enabled ; }


compute $ 2 ^ e \ mod n $ for e > 0 , n > 2

static long mod big integer ( final long e , final long n ) { long mask = ( e & 0x f f f f f f f f 0 0 0 0 0 0 0 0 l ) = = 0 ? 0x 0 0 0 0 0 0 0 0 f f f f f f f f l : 0x f f f f f f f f 0 0 0 0 0 0 0 0 l ; mask & = ( e & 0x f f f f 0 0 0 0 f f f f 0 0 0 0 l & mask ) = = 0 ? 0x 0 0 0 0 f f f f 0 0 0 0 f f f f l : 0x f f f f 0 0 0 0 f f f f 0 0 0 0 l ; mask & = ( e & 0x f f 0 0 f f 0 0 f f 0 0 f f 0 0 l & mask ) = = 0 ? 0x 0 0 f f 0 0 f f 0 0 f f 0 0 f f l : 0x f f 0 0 f f 0 0 f f 0 0 f f 0 0 l ; mask & = ( e & 0x f 0 f 0 f 0 f 0 f 0 f 0 f 0 f 0 l & mask ) = = 0 ? 0x 0 f 0 f 0 f 0 f 0 f 0 f 0 f 0 f l : 0x f 0 f 0 f 0 f 0 f 0 f 0 f 0 f 0 l ; mask & = ( e & 0x c c c c c c c c c c c c c c c c l & mask ) = = 0 ? 0x 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 l : 0x c c c c c c c c c c c c c c c c l ; mask & = ( e & 0x a a a a a a a a a a a a a a a a l & mask ) = = 0 ? 0x 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 l : 0x a a a a a a a a a a a a a a a a l ; final big integer n = big integer value of ( n ) ; long r = 2 ; for ( mask > > = 1 ; mask > 0 ; mask > > = 1 ) { if ( r < = modular max sqrt long ) { r * = r ; if ( r > = n ) r % = n ; } else { final big integer r = big integer value of ( r ) ; r = r multiply ( r ) mod ( n ) long value ( ) ; } if ( ( e & mask ) ! = 0 ) { r < < = 1 ; if ( r > = n ) r - = n ; } } return r ; }


returns a copy of the most recent data measured by this monitor

public gc data get latest gc data ( ) { return cur data clone ( ) ; }


smooth any 0 - count entries and calculate log probabilities

private static void smooth counts and calculate log probs ( int [ ] [ ] begin trigram counts , int [ ] [ ] end trigram counts , int [ ] [ ] [ ] trigram counts , long total trigrams ) { / / smooth for non - existing trigrams for ( int i = 0 ; i < ascii char count ; i + + ) { for ( int j = 0 ; j < ascii char count ; j + + ) { if ( begin trigram counts [ i ] [ j ] = = 0 ) { begin trigram counts [ i ] [ j ] = 1 ; total trigrams + + ; } if ( end trigram counts [ i ] [ j ] = = 0 ) { end trigram counts [ i ] [ j ] = 1 ; total trigrams + + ; } for ( int k = 0 ; k < ascii char count ; k + + ) { if ( trigram counts [ i ] [ j ] [ k ] = = 0 ) { trigram counts [ i ] [ j ] [ k ] = 1 ; total trigrams + + ; } } } } double [ ] [ ] begin log trigrams = log probs get begin log trigrams ( ) ; double [ ] [ ] end log trigrams = log probs get end log trigrams ( ) ; double [ ] [ ] [ ] log trigrams = log probs get log trigrams ( ) ; / / now calculate log probabilities for ( int i = 0 ; i < ascii char count ; i + + ) { for ( int j = 0 ; j < ascii char count ; j + + ) { begin log trigrams [ i ] [ j ] = math log 1 0 ( ( double ) begin trigram counts [ i ] [ j ] / ( double ) total trigrams ) ; end log trigrams [ i ] [ j ] = math log 1 0 ( ( double ) end trigram counts [ i ] [ j ] / ( double ) total trigrams ) ; for ( int k = 0 ; k < ascii char count ; k + + ) { log trigrams [ i ] [ j ] [ k ] = math log 1 0 ( ( double ) trigram counts [ i ] [ j ] [ k ] / ( double ) total trigrams ) ; } } } }


returns an unhealthy { @ link result } with a formatted message message formatting follows the same rules as { @ link string # format ( string , object ) }

public static result unhealthy ( string message , object args ) { return unhealthy ( string format ( message , args ) ) ; }


filters all exceptions that match the predicate by applying the given response provider function for instance , the following example creates a filter that returns a 500 response status when an { @ code illegal state exception } occurs < pre class = " code " > router function & lt ; server response & gt ; filtered route = router functions route ( ) get ( " user " , this : : list users ) on error ( e - > e instanceof illegal state exception , ( e , request ) - > server response status ( http status internal server error ) build ( ) ) build ( ) ;

builder on error ( predicate < ? super throwable > predicate , bi function < ? super throwable , server request , mono < server response > > response provider ) ;


returns the properties for the kafka consumer

public properties get properties ( ) { return properties ; }


sets the { @ link translation settings definition } setting

public settings builder set ( translation enum tenum ) { translation settings definition translation set enum value ( settings , tenum ) ; return this ; }


calls set status ( int sc , string msg ) on the wrapped { @ link http servlet response wrapper } object

public void set status ( int sc , string sm ) { status code = sc ; msg = sm ; super set status ( sc , sm ) ; }


sets the element of this big array at specified index

public void set ( long index , slice value ) { update retained size ( index , value ) ; array set ( index , value ) ; }


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


public long get record count ( ) { return this record count ; }


dump out contents of $ cwd and the environment to stdout for debugging

private void dump out debug info ( ) { log info ( " dump debug output " ) ; map < string , string > envs = system getenv ( ) ; for ( map entry < string , string > env : envs entry set ( ) ) { log info ( " system env : key = " + env get key ( ) + " , val = " + env get value ( ) ) ; system out println ( " system env : key = " + env get key ( ) + " , val = " + env get value ( ) ) ; } buffered reader buf = null ; try { string lines = shell windows ? shell exec command ( " cmd " , " / c " , " dir " ) : shell exec command ( " ls " , " - al " ) ; buf = new buffered reader ( new string reader ( lines ) ) ; string line = " " ; while ( ( line = buf read line ( ) ) ! = null ) { log info ( " system cwd content : " + line ) ; system out println ( " system cwd content : " + line ) ; } } catch ( i o exception e ) { e print stack trace ( ) ; } finally { i o utils cleanup with logger ( log , buf ) ; } }


in bazel this { @ code create stub action } considers { @ code java executable } as a file path for the jvm binary ( java )

public boolean is java executable substitution ( ) { return false ; }


returns the module composed of { @ code elements }

public static module get module ( final iterable < ? extends element > elements ) { return new module ( ) { @ override public void configure ( binder binder ) { for ( element element : elements ) { element apply to ( binder ) ; } } } ; }


return the java mail mime message that this mime mail message is based on

public final mime message get mime message ( ) { return this helper get mime message ( ) ; }


parse a set of { @ link char sequence } contexts at index - time acceptable formats : array : [ & lt ; string & gt ; , ] string : & quot ; string & quot ;

public set < string > parse context ( parse context parse context , x content parser parser ) throws i o exception , elasticsearch parse exception { final set < string > contexts = new hash set < > ( ) ; token token = parser current token ( ) ; if ( token = = token value string | | token = = token value number | | token = = token value boolean ) { contexts add ( parser text ( ) ) ; } else if ( token = = token start array ) { while ( ( token = parser next token ( ) ) ! = token end array ) { if ( token = = token value string | | token = = token value number | | token = = token value boolean ) { contexts add ( parser text ( ) ) ; } else { throw new elasticsearch parse exception ( " context array must have string , number or boolean values , but was [ " + token + " ] " ) ; } } } else { throw new elasticsearch parse exception ( " contexts must be a string , number or boolean or a list of string , number or boolean , but was [ " + token + " ] " ) ; } return contexts ; }


given a list of { @ code requested selectables } , returns all features that are enabled by the toolchain configuration a requested feature will not be enabled if the toolchain does not support it ( which may depend on other requested features ) additional features will be enabled if the toolchain supports them and they are implied by requested features if multiple threads call this method we may do additional work in initializing the cache this reinitialization is benign

public feature configuration get feature configuration ( immutable set < string > requested selectables ) throws colliding provides exception { try { if ( configuration cache = = null ) { configuration cache = build configuration cache ( ) ; } return configuration cache get ( requested selectables ) ; } catch ( execution exception e ) { throwables throw if instance of ( e get cause ( ) , colliding provides exception class ) ; throwables throw if unchecked ( e get cause ( ) ) ; throw new illegal state exception ( " unexpected checked exception encountered " , e ) ; } }


sets the quaternion to an identity quaternion

public quaternion idt ( ) { return this set ( 0 , 0 , 0 , 1 ) ; }


asserts that all pairs of { @ code t } values within { @ code values in expected order } are ordered consistently between their order within { @ code values in expected order } and the order implied by the given { @ code comparator }

public static < t > void test comparator ( comparator < ? super t > comparator , t values in expected order ) { test comparator ( comparator , arrays as list ( values in expected order ) ) ; }


sets the encapsulated value to another value


helper method to throw an exception if more than one type of { @ link script } is specified

private void throw only one of type ( ) { throw new illegal argument exception ( " must only use one of [ " + script type inline get parse field ( ) get preferred name ( ) + " , " + script type stored get parse field ( ) get preferred name ( ) + " ] " + " when specifying a script " ) ; }


scoring mechanism : determines destination similarity and confidence for each of the source neighbors and if similarity passes the threshold and confidence passes minbits , then v t match info will be created and added to the result

private list < v t match info > transform ( v t match set match set , function destination function , l s h cosine vector accum destination vector , hash map < address , dominant pair < double , vector compare > > neighbors , double similarity threshold , double minbits , task monitor monitor ) { boolean refine result = get options ( ) get boolean ( refine results , refine results default ) ; address destination address = destination function get entry point ( ) ; int destination length = ( int ) destination function get body ( ) get num addresses ( ) ; list < v t match info > result = new array list < > ( ) ; for ( entry < address , dominant pair < double , vector compare > > neighbor : neighbors entry set ( ) ) { if ( monitor is cancelled ( ) ) { break ; } address source addr = neighbor get key ( ) ; / * compare using l s h cosine vector compare function * - - > similarity is the normalized dot product of the two vectors * / double similarity = neighbor get value ( ) first ; vector compare veccompare = neighbor get value ( ) second ; veccompare fill out ( ) ; double confidence = veccompare dotproduct ; if ( similarity < similarity threshold | | double is na n ( similarity ) ) { continue ; } if ( confidence < minbits ) { continue ; } confidence * = 10 0 ; / / remove when getting rid of log 1 0 stuff v t match info match = new v t match info ( match set ) ; function source function = source listing get function at ( source addr ) ; address source address = source function get entry point ( ) ; int source length = ( int ) source function get body ( ) get num addresses ( ) ; match set similarity score ( new v t score ( similarity ) ) ; match set confidence score ( new v t score ( confidence ) ) ; match set source length ( source length ) ; match set destination length ( destination length ) ; match set source address ( source address ) ; match set destination address ( destination address ) ; match set tag ( null ) ; match set association type ( v t association type function ) ; result add ( match ) ; } if ( refine result ) { result = refine ( result ) ; } return result ; }


the value assigned to this plural < code > optional aapt pb item item = 4 ; < code >

public boolean has item ( ) { return instance has item ( ) ; }


modifies the data type of an accumulator regarding data views for performance reasons , each data view is wrapped into a raw type which gives it { @ link lazy binary format } semantics and avoids multiple deserialization steps during access furthermore , a data view will not be serialized if a state backend is used ( the serializer of the raw type will be a { @ link null serializer } in this case )

public static data type adjust data views ( data type accumulator data type , boolean has state backed data views ) { final function < data type , type serializer < ? > > serializer ; if ( has state backed data views ) { serializer = data type - > null serializer instance ; } else { serializer = external serializer : : of ; } return data type utils transform ( accumulator data type , new data views transformation ( serializer ) ) ; }


this method is meant for invoking the rewrite logic on children while processing a node

public plan node rewrite ( plan node node ) { return rewrite ( node , null ) ; }


exit a parse tree produced by { @ link sql base parser # function expression }

void exit function expression ( sql base parser function expression context ctx ) ;


the source file information of the parent inheritance declaration < code > optional aapt pb source parent source = 2 ; < code >

private void merge parent source ( com android aapt resources source value ) { if ( parent source ! = null & & parent source ! = com android aapt resources source get default instance ( ) ) { parent source = com android aapt resources source new builder ( parent source ) merge from ( value ) build partial ( ) ; } else { parent source = value ; } bit field 0 | = 0x 0 0 0 0 0 0 0 2 ; }


public disk balancer data node get node by name ( string host name ) { return host names get ( host name ) ; }


gets the token from the < code > authorization < code > header if the header begins with < code > bearer < code >

private string get from header ( thread context thread context ) { string header = thread context get header ( " authorization " ) ; if ( strings has text ( header ) & & header region matches ( true , 0 , " bearer " , 0 , " bearer " length ( ) ) & & header length ( ) > " bearer " length ( ) ) { return header substring ( " bearer " length ( ) ) ; } return null ; }


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


test an oom situation where there are no containers that can be killed

public void test exception thrown with no containers to kill ( ) throws exception { context context = mock ( context class ) ; when ( context get containers ( ) ) then return ( new concurrent hash map < > ( 0 ) ) ; c groups handler c groups handler = mock ( c groups handler class ) ; when ( c groups handler get c group param ( c groups handler c group controller memory , " " , cgroup param memory oom control ) ) then return ( " under oom 1 " ) then return ( " under oom 0 " ) ; default o o m handler handler = new default o o m handler ( context , false ) { @ override protected c groups handler get c groups handler ( ) { return c groups handler ; } } ; handler run ( ) ; }


find the variable symbol in other program which corresponds to the specified var sym

public static symbol get variable symbol ( symbol symbol , program other program ) { symbol other parent = get symbol ( symbol get parent symbol ( ) , other program ) ; namespace namespace = other parent = = null ? null : ( namespace ) other parent get object ( ) ; return get variable symbol ( symbol , other program , namespace ) ; }


check if replication queues are to be populated

public boolean is populating repl queues ( ) { if ( ! should populate repl queues ( ) ) { return false ; } return initialized repl queues ; }


set the socket address for the < code > name < code > property as a < code > host : port < code >

public void set socket addr ( string name , inet socket address addr ) { set ( name , net utils get host port string ( addr ) ) ; }


a variant of { @ link # execute ( session callback , boolean ) } that explicitly creates a non - transactional { @ link session } the given { @ link session callback } does not participate in an existing transaction

private < t > t execute local ( session callback < t > action , boolean start connection ) throws jms exception { assert not null ( action , " callback object must not be null " ) ; connection con = null ; session session = null ; try { con = create connection ( ) ; session = con create session ( false , session auto acknowledge ) ; if ( start connection ) { con start ( ) ; } if ( logger is debug enabled ( ) ) { logger debug ( " executing callback on jms session : " + session ) ; } return action do in jms ( session ) ; } catch ( j m s exception ex ) { throw convert jms access exception ( ex ) ; } finally { jms utils close session ( session ) ; connection factory utils release connection ( con , get connection factory ( ) , start connection ) ; } }


returns all the registered { @ link trigger } descriptors

public static descriptor extension list < trigger < ? > , trigger descriptor > all ( ) { return ( descriptor extension list ) jenkins get ( ) get descriptor list ( trigger class ) ; }


returns { @ code true } if the provided row key is among the row keys provided when the table was constructed

public boolean contains row ( @ nullable object row key ) { return row key to index contains key ( row key ) ; }


saves the property at the given index to the given output stream

protected void save property ( object output stream oos , long index ) throws i o exception { try { oos write long ( get long ( index ) ) ; } catch ( no value exception e ) { throw new assert exception ( e get message ( ) ) ; } }


public base adapter helper set text color res ( int view id , int text color res ) { text view view = retrieve view ( view id ) ; view set text color ( context get resources ( ) get color ( text color res ) ) ; return this ; }


release all nodes held by this node manager this method must be invoked before a database transaction can be committed

int release nodes ( ) throws i o exception { for ( b tree node node : node table values ( ) ) { if ( node instanceof record node ) { leaf record cnt - = node get key count ( ) ; } buffer mgr release buffer ( node get buffer ( ) ) ; } node table = new hash map < > ( ) ; int result = - leaf record cnt ; leaf record cnt = 0 ; return result ; }


sets the y - coordinate of circle center

public void set y ( float y ) { this y = y ; }


public int get proc len ( ) { return proc len ; }


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


returns a logger that crashes as soon as it ' s written to , since tests should not cause events that would be logged

public static future < logger > get test crash logger ( ) { logger crash logger = logger get anonymous logger ( ) ; crash logger add handler ( new handler ( ) { @ override public void publish ( log record record ) { system err println ( " remote logging disabled for testing , forcing abrupt shutdown " ) ; system err printf ( " % s # % s : % s \ n " , record get source class name ( ) , record get source method name ( ) , record get message ( ) ) ; throwable e = record get thrown ( ) ; if ( e ! = null ) { e print stack trace ( ) ; } runtime get runtime ( ) halt ( exit code blaze internal error get numeric exit code ( ) ) ; } @ override public void flush ( ) { throw new illegal state exception ( ) ; } @ override public void close ( ) { throw new illegal state exception ( ) ; } } ) ; return futures immediate future ( crash logger ) ; }


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


get the media type of the body , as specified by the { @ code content - type } header

optional < media type > content type ( ) ;


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


from https : github comtojigame - shimblobmastergame - shim js

private native void set cursor catched j s n i ( canvas element element ) / * - { / / navigator pointer is not the right interface according to spec / / here for backwards compatibility only if ( ! navigator pointer ) { navigator pointer = navigator pointer | | navigator webkit pointer | | navigator moz pointer ; } / / element request pointer lock if ( ! element request pointer lock ) { element request pointer lock = ( function ( ) { return element webkit request pointer lock | | element moz request pointer lock | | function ( ) { if ( navigator pointer ) { navigator pointer lock ( element ) ; } } ; } ) ( ) ; } element request pointer lock ( ) ; }


when enabled , slice spacing will be 0 0 when the smallest value is going to be smaller than the slice spacing itself

public void set automatically disable slice spacing ( boolean auto disable ) { m automatically disable slice spacing = auto disable ; }


returns the addresses that this subchannel is bound to the returned list will not be empty it should be called from the synchronization context currently will log a warning if violated it will become an exception eventually see < a href = " https : github comgrpcgrpc - javaissues 5 0 1 5 " > # 5015 for the background

public list < equivalent address group > get all addresses ( ) { throw new unsupported operation exception ( ) ; }


read an op it also checks protocol version

protected final op read op ( ) throws i o exception { final short version = in read short ( ) ; if ( version ! = data transfer protocol data transfer version ) { throw new i o exception ( " version mismatch ( expected : " + data transfer protocol data transfer version + " , received : " + version + " ) " ) ; } return op read ( in ) ; }


increment or decrement the number of bytes that have been allocated to service this request and potentially trigger a { @ link circuit breaking exception } the number of bytes allocated is automatically decremented with the circuit breaker service on closure of this aggregator if memory has been returned , decrement it without tripping the breaker for performance reasons subclasses should not call this millions of times each with small increments and instead batch up into larger allocations

protected long add request circuit breaker bytes ( long bytes ) { / / only use the potential to circuit break if bytes are being incremented if ( bytes > 0 ) { context breaker ( ) add estimate bytes and maybe break ( bytes , " < agg [ " + name + " ] > " ) ; } else { context breaker ( ) add without breaking ( bytes ) ; } this request bytes used + = bytes ; return request bytes used ; }


returns a registered { @ link tokenizer factory } provider by { @ link index settings } or a registered { @ link tokenizer factory } provider by predefined name or < code > null < code > if the tokenizer was not registered

private analysis provider < tokenizer factory > get tokenizer provider ( string tokenizer , index settings index settings ) { return get provider ( component tokenizer , tokenizer , index settings , " index analysis tokenizer " , tokenizers , this : : get tokenizer provider ) ; }


{ @ inherit doc } the default implementation does nothing

@ override public void exit event filter ( eql base parser event filter context ctx ) { }


returns a new { @ link char source } for reading character data from the given file using the given character set

public static char source as char source ( file file , charset charset ) { return as byte source ( file ) as char source ( charset ) ; }


prepare filter before execution and provide optional

protected optional < object > prepare filter before execution ( final http servlet response http servlet response , final http servlet request http servlet request ) { return optional empty ( ) ; }


return byte offset to the auxiliary data

public int get aux offset ( ) { return aux offset ; }


determines the identity in which the { @ link hudson model queue executable } will run as the default implementation delegates to { @ link # authenticate 2 ( hudson model queue task ) }

public @ check for null authentication authenticate 2 ( queue item item ) { if ( util is overridden ( queue item authenticator class , get class ( ) , " authenticate 2 " , queue task class ) ) { return authenticate 2 ( item task ) ; } else if ( util is overridden ( queue item authenticator class , get class ( ) , " authenticate " , queue task class ) ) { org acegisecurity authentication a = authenticate ( item task ) ; return a ! = null ? a to spring ( ) : null ; } else if ( util is overridden ( queue item authenticator class , get class ( ) , " authenticate " , queue item class ) ) { org acegisecurity authentication a = authenticate ( item ) ; return a ! = null ? a to spring ( ) : null ; } else { throw new abstract method error ( " you must override at least one of the queue item authenticator authenticate 2 methods " ) ; } }


returns the image type for the given input stream

public static image type get type ( @ non null list < image header parser > parsers , @ nullable input stream is , @ non null array pool byte array pool ) throws i o exception { if ( is = = null ) { return image type unknown ; } if ( ! is mark supported ( ) ) { is = new recyclable buffered input stream ( is , byte array pool ) ; } is mark ( mark read limit ) ; final input stream final is = is ; return get type internal ( parsers , new type reader ( ) { @ override public image type get type ( image header parser parser ) throws i o exception { try { return parser get type ( final is ) ; } finally { final is reset ( ) ; } } } ) ; }


public glyph layout add text ( char sequence str , float x , float y ) { return add text ( str , x , y , 0 , str length ( ) , 0 , align left , false , null ) ; }


lookup the { @ link kv state location } for the given job and queryable state name the job manager will be queried for the location only if forced or no cached location can be found there are no guarantees about

private completable future < kv state location > get kv state lookup info ( final job i d job id , final string queryable state name , final boolean force update ) { final tuple 2 < job i d , string > cache key = new tuple 2 < > ( job id , queryable state name ) ; final completable future < kv state location > cached future = lookup cache get ( cache key ) ; if ( ! force update & & cached future ! = null & & ! cached future is completed exceptionally ( ) ) { log debug ( " retrieving location for state = { } of job = { } from the cache " , queryable state name , job id ) ; return cached future ; } final kv state location oracle kv state location oracle = proxy get kv state location oracle ( job id ) ; if ( kv state location oracle ! = null ) { log debug ( " retrieving location for state = { } of job = { } from the key - value state location oracle " , queryable state name , job id ) ; final completable future < kv state location > location = new completable future < > ( ) ; lookup cache put ( cache key , location ) ; kv state location oracle request kv state location ( job id , queryable state name ) when complete ( ( kv state location kv state location , throwable throwable ) - > { if ( throwable ! = null ) { if ( exception utils strip completion exception ( throwable ) instanceof flink job not found exception ) { / / if the job id was wrong , remove the entry from the cache lookup cache remove ( cache key ) ; } location complete exceptionally ( throwable ) ; } else { location complete ( kv state location ) ; } } ) ; return location ; } else { return future utils completed exceptionally ( new unknown location exception ( " could not retrieve location of state = " + queryable state name + " of job = " + job id + " potential reasons are : i ) the state is not ready , or ii ) the job does not exist " ) ) ; } }


copy a script , renaming references to the class name

private void copy script ( resource file source script , resource file destination script ) throws i o exception { string old class name = ghidra script util get base name ( source script ) ; string new class name = ghidra script util get base name ( destination script ) ; resource file parent file = source script get parent file ( ) ; resource file temp = new resource file ( parent file , " ghidra script tmp " ) ; try ( print writer writer = new print writer ( temp get output stream ( ) ) ) { try ( buffered reader reader = new buffered reader ( new input stream reader ( source script get input stream ( ) ) ) ) { while ( true ) { string line = reader read line ( ) ; if ( line = = null ) { break ; } writer println ( line replace all ( old class name , new class name ) ) ; } } } file utilities copy file ( temp , destination script , task monitor dummy ) ; temp delete ( ) ; }


sql < code > round < code > operator applied to double values

public static double sround ( double b 0 ) { return sround ( b 0 , 0 ) ; }


by default when a resource is found , the path of the resolved resource is compared to ensure it ' s under the input location where it was found however sometimes that may not be the case , e g when { @ link org springframework web servlet resource css link resource transformer } resolves public u r ls of links it contains , the css file is the location and the resources being resolved are css files , images , fonts and others located in adjacent or parent directories this property allows configuring a complete list of locations under which resources must be so that if a resource is not under the location relative to which it was found , this list may be checked as well by default { @ link resource http request handler } initializes this property to match its list of locations

public void set allowed locations ( @ nullable resource locations ) { this allowed locations = locations ; }


public string [ ] get diagnostics ( ) { return diagnostics ; }


return all names of the group of constants for the given bean property name

public set < string > get names for property ( string property name ) { return get names ( property to constant name prefix ( property name ) ) ; }


record a value at a known time this method is slightly faster than { @ link # record ( double ) } since it will reuse the time stamp

public void record ( double value , long time ms , boolean check quotas ) { if ( should record ( ) ) { record internal ( value , time ms , check quotas ) ; } }


asserts that a zero byte file has a status of file and not directory or symlink

public void test zero byte files are files ( ) throws exception { path src = path ( " test zero byte files are files " ) ; / / create a zero byte file f s data output stream out = fs create ( src ) ; out close ( ) ; assert is file ( src ) ; }


adds one edge and leaf to this tree node , or returns an existing node if any

public child intern ( final string s ) { if ( s length ( ) = = 0 ) { return this ; } make writable ( ) ; for ( map entry < string , child > e : children entry set ( ) ) { int plen = common prefix ( e get key ( ) , s ) ; if ( plen > 0 ) { if ( plen < e get key ( ) length ( ) ) { / / insert a node between this and e value child c = e get value ( ) ; string prefix = s substring ( 0 , plen ) ; child middle = c split ( prefix ) ; / / add ' middle ' instead of ' c ' children remove ( e get key ( ) ) ; children put ( prefix , middle ) ; return middle intern ( s substring ( plen ) ) ; } else { / / entire key is suffix return e get value ( ) intern ( s substring ( plen ) ) ; } } } / / no common prefix an entirely new node child t = children get ( s ) ; if ( t = = null ) { children put ( s , t = new child ( new tree string ( node , s ) ) ) ; } return t ; }


reads two code units , treating them as a little - endian { @ code int }

public int read int ( ) throws e o f exception ;


configure with the provided { @ link serde serde < v2 > } for the other value

public stream joined < k , v1 , v2 > with other value serde ( final serde < v2 > other value serde ) { return new stream joined < > ( key serde , value serde , other value serde , this store supplier , other store supplier , name , store name , logging enabled , topic config ) ; }


datanode are not verified to be in the same nameservice as the old block todo this may require validation

public void update pipeline ( string client name , extended block old block , extended block new block , datanode i d [ ] new nodes , string [ ] new storage i ds ) throws i o exception { rpc server check operation ( name node operation category write ) ; remote method method = new remote method ( " update pipeline " , new class < ? > [ ] { string class , extended block class , extended block class , datanode i d [ ] class , string [ ] class } , client name , old block , new block , new nodes , new storage i ds ) ; rpc client invoke single ( old block , method ) ; }


public string type ( ) { return parent type ; }


retrieves product information that desktop clients need

public desktop product get product desktop ( ) { var desktop product = new desktop product ( ) ; desktop product set image path ( image client get image path ( ) ) ; desktop product set price ( price client get price ( ) ) ; return desktop product ; }


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


get the maximum number of vcores supported by the yarn cluster

int get max vcores ( ) throws flink exception ;


create label op tpl uses overloaded pcode op ptradd with input [ 0 ] = label index

private op tpl get label op template ( address factory addr factory , int label index ) { const tpl offset tpl = new const tpl ( const tpl real , label index ) ; const tpl space tpl = new const tpl ( addr factory get constant space ( ) ) ; const tpl size tpl = new const tpl ( const tpl real , 8 ) ; varnode tpl input = new varnode tpl ( space tpl , offset tpl , size tpl ) ; return new op tpl ( pcode op ptradd , null , new varnode tpl [ ] { input } ) ; }


visit a parse tree produced by the { @ code sys columns } labeled alternative in { @ link sql base parser # statement }

t visit sys columns ( sql base parser sys columns context ctx ) ;


throws an invalid data type exception with a default message indicating the data type and address where it is invalid that is followed by the message from the exception passed to this method

protected void invalid ( exception e ) throws invalid data type exception { string message = get default invalid message ( ) ; string exc message = e get message ( ) ; if ( exc message ! = null & & ! exc message is empty ( ) ) { message + = " " + exc message ; } throw new invalid data type exception ( message ) ; }


enriches search hits and completion suggestion hits from < code > sorted docs < code > using < code > fetch results arr < code > , merges suggestions , aggregations and profile results expects sorted docs to have top search docs across all shards , optionally followed by top suggest docs for each named completion suggestion ordered by suggestion name

public internal search response merge ( boolean ignore from , reduced query phase reduced query phase , collection < ? extends search phase result > fetch results , int function < search phase result > results lookup ) { if ( reduced query phase is empty result ) { return internal search response empty ( ) ; } score doc [ ] sorted docs = reduced query phase sorted top docs score docs ; search hits hits = get hits ( reduced query phase , ignore from , fetch results , results lookup ) ; if ( reduced query phase suggest ! = null ) { if ( ! fetch results is empty ( ) ) { int current offset = hits get hits ( ) length ; for ( completion suggestion suggestion : reduced query phase suggest filter ( completion suggestion class ) ) { final list < completion suggestion entry option > suggestion options = suggestion get options ( ) ; for ( int score doc index = current offset ; score doc index < current offset + suggestion options size ( ) ; score doc index + + ) { score doc shard doc = sorted docs [ score doc index ] ; search phase result search result provider = results lookup apply ( shard doc shard index ) ; if ( search result provider = = null ) { / / this can happen if we are hitting a shard failure during the fetch phase / / in this case we referenced the shard result via the score doc but never got a / / result from fetch / / todo it would be nice to assert this in the future continue ; } fetch search result fetch result = search result provider fetch result ( ) ; final int index = fetch result counter get and increment ( ) ; assert index < fetch result hits ( ) get hits ( ) length : " not enough hits fetched index [ " + index + " ] length : " + fetch result hits ( ) get hits ( ) length ; search hit hit = fetch result hits ( ) get hits ( ) [ index ] ; completion suggestion entry option suggest option = suggestion options get ( score doc index - current offset ) ; hit score ( shard doc score ) ; hit shard ( fetch result get search shard target ( ) ) ; suggest option set hit ( hit ) ; } current offset + = suggestion options size ( ) ; } assert current offset = = sorted docs length : " expected no more score doc slices " ; } } return reduced query phase build response ( hits ) ; }


drops a view in a given fully qualified path

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


public void test decommission status ( ) throws exception { inet socket address addr = new inet socket address ( " localhost " , cluster get name node port ( ) ) ; d f s client client = new d f s client ( addr , conf ) ; datanode info [ ] info = client datanode report ( datanode report type live ) ; assert equals ( " number of datanodes " , 2 , info length ) ; distributed file system file sys = cluster get file system ( ) ; d f s admin admin = new d f s admin ( cluster get configuration ( 0 ) ) ; short replicas = num datanodes ; / / / / decommission one node verify the decommission status / / path file 1 = new path ( " decommission dat " ) ; d f s test util create file ( file sys , file 1 , file size , file size , block size , replicas , seed ) ; path file 2 = new path ( " decommission 1 dat " ) ; f s data output stream st 1 = admin states base test write incomplete file ( file sys , file 2 , replicas , ( short ) ( file size / block size ) ) ; for ( data node d : cluster get data nodes ( ) ) { data node test utils trigger block report ( d ) ; } f s namesystem fsn = cluster get namesystem ( ) ; final datanode manager dm = fsn get block manager ( ) get datanode manager ( ) ; for ( int iteration = 0 ; iteration < num datanodes ; iteration + + ) { string downnode = decommission node ( client , iteration ) ; dm refresh nodes ( conf ) ; decommissioned nodes add ( downnode ) ; block manager test util recheck decommission state ( dm ) ; / / block until the admin ' s monitor updates the number of tracked nodes wait for decommissioned nodes ( dm get datanode admin manager ( ) , iteration + 1 ) ; final list < datanode descriptor > decommissioning nodes = dm get decommissioning nodes ( ) ; if ( iteration = = 0 ) { assert equals ( decommissioning nodes size ( ) , 1 ) ; datanode descriptor decomm node = decommissioning nodes get ( 0 ) ; check decommission status ( decomm node , 3 , 0 , 1 ) ; check d f s admin decommission status ( decommissioning nodes sub list ( 0 , 1 ) , file sys , admin ) ; } else { assert equals ( decommissioning nodes size ( ) , 2 ) ; datanode descriptor decomm node 1 = decommissioning nodes get ( 0 ) ; datanode descriptor decomm node 2 = decommissioning nodes get ( 1 ) ; / / this one is still 3 , 3 , 1 since it passed over the uc block / / earlier , before node 2 was decommed check decommission status ( decomm node 1 , 3 , 3 , 1 ) ; / / this one is 4 , 4 , 2 since it has the full state check decommission status ( decomm node 2 , 4 , 4 , 2 ) ; check d f s admin decommission status ( decommissioning nodes sub list ( 0 , 2 ) , file sys , admin ) ; } } / / call refresh nodes on f s namesystem with empty exclude file / / this will remove the datanodes from decommissioning list and / / make them available again hosts file writer init exclude host ( " " ) ; dm refresh nodes ( conf ) ; st 1 close ( ) ; admin states base test cleanup file ( file sys , file 1 ) ; admin states base test cleanup file ( file sys , file 2 ) ; }


public boolean is close on completion ( ) throws s q l exception { return false ; }


insert all hashes associated with unknown ( i e not matched ) blocks and instructions

public void insert hashes ( ) { for ( block block : block list values ( ) ) { for ( int j = 0 ; j < block inst list length ; + + j ) { instruct hash instruct = block inst list [ j ] ; if ( instruct is matched ) continue ; insert instruction n grams ( instruct ) ; } } }


fully skips the specified size from the given input stream { @ link input stream # skip ( long ) } has two problems one is that it doesn ' t let us reliably differentiate " hit eof " case vs " inputstream just returning 0 since there ' s no data currently available at hand " , and some subtypes ( such as { @ link file input stream # skip ( long ) } returning - 1 so to reliably skip just the n bytes , we ' ll actually read all those bytes

public static input stream skip ( input stream in , long size ) throws i o exception { data input stream di = new data input stream ( in ) ; while ( size > 0 ) { int chunk = ( int ) math min ( skip buffer length , size ) ; di read fully ( skip buffer , 0 , chunk ) ; size - = chunk ; } return in ; }


public long long value ( ) { return max ( ) ; }


specify an action to take when the block ends if not specified , nothing special happens

public void set disposer ( @ non null disposer disposer ) { if ( this disposer ! = null ) { throw new illegal state exception ( " just one disposer " ) ; } / / assumption : the provided disposer instance is only associated with one wrapper at a time , or at least / / only with wrappers that agree on whether or not a workspace is required disposer wrapper requires workspace = this wrapper requires workspace ; this disposer = disposer ; }


public domain file get domain file ( ) { return domain file ; }


the sink node making the request < code > istio mcp v 1alpha 1 sink node sink node = 1 ; < code >

public boolean has sink node ( ) { return sink node ! = null ; }


check if indices permissions allow for the given action

public boolean check indices action ( string action ) { return indices check ( action ) ; }


creates a new tuple and assigns the given values to the tuple ' s fields this is more convenient than using the constructor , because the compiler can infer the generic type arguments implicitly for example : { @ code tuple 3 of ( n , x , s ) } instead of { @ code new tuple 3 < integer , double , string > ( n , x , s ) }


analysis the { @ link org litepal tablemanager model associations model } by the purpose of subclasses , and generate a sql to do the intention job the implementation of this method is totally delegated to the subclasses

protected abstract void add or update association ( s q lite database db , boolean force ) ;


tests that a canceled future throws a cancellation exception this method checks the cancel , is cancelled , and is done methods

public void test canceled future throws cancellation ( ) throws exception { assert false ( future is done ( ) ) ; assert false ( future is cancelled ( ) ) ; final count down latch success latch = new count down latch ( 1 ) ; / / run cancellation in a separate thread as an extra thread - safety test new thread ( new runnable ( ) { @ override public void run ( ) { try { future get ( ) ; } catch ( cancellation exception expected ) { success latch count down ( ) ; } catch ( exception ignored ) { / / all other errors are ignored , we expect a cancellation } } } ) start ( ) ; assert false ( future is done ( ) ) ; assert false ( future is cancelled ( ) ) ; future cancel ( true ) ; assert true ( future is done ( ) ) ; assert true ( future is cancelled ( ) ) ; assert true ( success latch await ( 200 , time unit milliseconds ) ) ; latch count down ( ) ; }


void set append chunk ( boolean append chunk ) { this append chunk = append chunk ; }


a sensible definition of { @ link # lower entry } in terms of the { @ code last entry ( ) } of { @ link # head map ( object , boolean ) } if you override { @ code head map } , you may wish to override { @ code lower entry } to forward to this implementation

protected entry < k , v > standard lower entry ( k key ) { return head map ( key , false ) last entry ( ) ; }


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


@ test public void test consumer exception ( ) throws exception { final sink queue < integer > q = new sink queue < integer > ( 1 ) ; final runtime exception ex = new runtime exception ( " expected " ) ; q enqueue ( 1 ) ; try { q consume ( new consumer < integer > ( ) { @ override public void consume ( integer e ) { throw ex ; } } ) ; } catch ( exception expected ) { assert same ( " consumer exception " , ex , expected ) ; } / / the queue should be in consistent state after exception assert equals ( " queue size " , 1 , q size ( ) ) ; assert equals ( " element " , 1 , ( int ) q dequeue ( ) ) ; }


test that changing the symlink prefix builds into another directory

public void test symlink prefix ( ) throws exception { write ( " my clib / build " , " cc library ( name = ' my clib ' , srcs = [ ' myclib cc ' ] ) \ n " ) ; write ( " my clib / myclib cc " , " void f ( ) { } " ) ; add options ( " - - symlink prefix = myblaze - " ) ; build ( false , " no - error " , " / / my clib " ) ; string stderr = rec out err err as latin 1 ( ) ; assert that ( stderr ) contains ( " target / / my clib : my clib up - to - date : \ n " ) ; assert that ( stderr ) contains ( " myblaze - bin / my clib / libmy clib so \ n " ) ; assert that ( stderr ) contains ( " myblaze - bin / my clib / libmy clib a \ n " ) ; }


sets a flag to interrupt delivery of any currently queued messages this may be invoked outside of the deframing thread , and must be followed by a call to { @ link # close ( ) } in the deframing thread without a subsequent call to { @ link # close ( ) } , the deframer may hang waiting for additional messages before noticing that the { @ code stop delivery } flag has been set

void stop delivery ( ) { stop delivery = true ; }


public short e csum ( ) { return e csum ; }


test with record length set to a negative value

public void test negative record length ( ) throws exception { local fs delete ( work dir , true ) ; path file = new path ( work dir , new string ( " test format txt " ) ) ; create file ( file , null , 10 , 10 ) ; / / set the fixed length record length config property job job = job get instance ( default conf ) ; fixed length input format format = new fixed length input format ( ) ; format set record length ( job get configuration ( ) , - 10 ) ; file input format set input paths ( job , work dir ) ; list < input split > splits = format get splits ( job ) ; boolean exception thrown = false ; for ( input split split : splits ) { try { task attempt context context = map reduce test util create dummy map task attempt context ( job get configuration ( ) ) ; record reader < long writable , bytes writable > reader = format create record reader ( split , context ) ; map context < long writable , bytes writable , long writable , bytes writable > mcontext = new map context impl < long writable , bytes writable , long writable , bytes writable > ( job get configuration ( ) , context get task attempt i d ( ) , reader , null , null , map reduce test util create dummy reporter ( ) , split ) ; reader initialize ( split , mcontext ) ; } catch ( i o exception ioe ) { exception thrown = true ; log info ( " exception message : " + ioe get message ( ) ) ; } } assert true ( " exception for negative record length : " , exception thrown ) ; }


reverse the jsonml transformation , making an xml text from a j s o n array

public static string to string ( j s o n array ja ) throws j s o n exception { object e ; int i ; j s o n object jo ; string k ; iterator keys ; int length ; string builder sb = new string builder ( ) ; string tag name ; string v ; / / emit < tag name tag name = ja get string ( 0 ) ; xml no space ( tag name ) ; tag name = xml escape ( tag name ) ; sb append ( ' < ' ) ; sb append ( tag name ) ; e = ja opt ( 1 ) ; if ( e instanceof j s o n object ) { i = 2 ; jo = ( j s o n object ) e ; / / emit the attributes keys = jo keys ( ) ; while ( keys has next ( ) ) { k = keys next ( ) to string ( ) ; xml no space ( k ) ; v = jo opt string ( k ) ; if ( v ! = null ) { sb append ( ' ' ) ; sb append ( xml escape ( k ) ) ; sb append ( ' = ' ) ; sb append ( ' " ' ) ; sb append ( xml escape ( v ) ) ; sb append ( ' " ' ) ; } } } else { i = 1 ; } / / emit content in body length = ja length ( ) ; if ( i > = length ) { sb append ( ' / ' ) ; sb append ( ' > ' ) ; } else { sb append ( ' > ' ) ; do { e = ja get ( i ) ; i + = 1 ; if ( e ! = null ) { if ( e instanceof string ) { sb append ( xml escape ( e to string ( ) ) ) ; } else if ( e instanceof j s o n object ) { sb append ( to string ( ( j s o n object ) e ) ) ; } else if ( e instanceof j s o n array ) { sb append ( to string ( ( j s o n array ) e ) ) ; } } } while ( i < length ) ; sb append ( ' < ' ) ; sb append ( ' / ' ) ; sb append ( tag name ) ; sb append ( ' > ' ) ; } return sb to string ( ) ; }


{ @ inherit doc } the default implementation does nothing

@ override public void enter pattern escape ( sql base parser pattern escape context ctx ) { }


create a { @ link producer } which is used to write records to sink topics

producer < byte [ ] , byte [ ] > get producer ( final map < string , object > config ) ;


public object mapper get mapper ( ) { return mapper ; }


returns the restart strategy which has been set for the current job

public restart strategies restart strategy configuration get restart strategy ( ) { if ( restart strategy configuration instanceof restart strategies fallback restart strategy configuration ) { / / support the old api calls by creating a restart strategy from them if ( get number of execution retries ( ) > 0 & & get execution retry delay ( ) > = 0 ) { return restart strategies fixed delay restart ( get number of execution retries ( ) , get execution retry delay ( ) ) ; } else if ( get number of execution retries ( ) = = 0 ) { return restart strategies no restart ( ) ; } else { return restart strategy configuration ; } } else { return restart strategy configuration ; } }


tests that the command line arguments override the configuration settings when the { @ link cluster specification } is created

public void test command line cluster specification ( ) throws exception { final configuration configuration = new configuration ( ) ; final int job manager memory = 1337 ; final int task manager memory = 7331 ; final int slots per task manager = 30 ; configuration set ( job manager options total process memory , memory size of mebi bytes ( job manager memory ) ) ; configuration set ( task manager options total process memory , memory size of mebi bytes ( task manager memory ) ) ; configuration set integer ( task manager options num task slots , slots per task manager ) ; final string [ ] args = { " - yjm " , string value of ( job manager memory ) + " m " , " - ytm " , string value of ( task manager memory ) + " m " , " - ys " , string value of ( slots per task manager ) } ; final flink yarn session cli flink yarn session cli = create flink yarn session cli ( configuration ) ; command line command line = flink yarn session cli parse command line options ( args , false ) ; configuration executor config = flink yarn session cli to configuration ( command line ) ; cluster client factory < application id > client factory = get cluster client factory ( executor config ) ; cluster specification cluster specification = client factory get cluster specification ( executor config ) ; assert that ( cluster specification get master memory m b ( ) , is ( job manager memory ) ) ; assert that ( cluster specification get task manager memory m b ( ) , is ( task manager memory ) ) ; assert that ( cluster specification get slots per task manager ( ) , is ( slots per task manager ) ) ; }


sets the current index to the specified value the pointer index will allow the reader to operate as a psuedo - iterator

public void set pointer index ( long index ) { this current index = index ; }


utility function to ensure that the configured base znode exists this recursively creates the znode as well as all of its parents

public synchronized void ensure parent z node ( ) throws i o exception , interrupted exception , keeper exception { preconditions check state ( ! want to be in election , " ensure parent z node ( ) may not be called while in the election " ) ; if ( zk client = = null ) { create connection ( ) ; } string path parts [ ] = znode working dir split ( " / " ) ; preconditions check argument ( path parts length > = 1 & & path parts [ 0 ] is empty ( ) , " invalid path : % s " , znode working dir ) ; string builder sb = new string builder ( ) ; for ( int i = 1 ; i < path parts length ; i + + ) { sb append ( " / " ) append ( path parts [ i ] ) ; string prefix path = sb to string ( ) ; log debug ( " ensuring existence of " + prefix path ) ; try { create with retries ( prefix path , new byte [ ] { } , zk acl , create mode persistent ) ; } catch ( keeper exception e ) { if ( is node exists ( e code ( ) ) ) { / / set a c ls for parent node , if they do not exist or are different try { set acls with retries ( prefix path ) ; } catch ( keeper exception e 1 ) { throw new i o exception ( " couldn ' t set a c ls on parent z node : " + prefix path , e 1 ) ; } } else { throw new i o exception ( " couldn ' t create " + prefix path , e ) ; } } } log info ( " successfully created " + znode working dir + " in zk " ) ; }


see { @ link # target libc top label } documentation

public fragment options get normalized ( ) { cpp options new options = ( cpp options ) this clone ( ) ; boolean changed = false ; if ( target libc top label ! = null & & target libc top label get name ( ) equals ( target libc top not yet set ) ) { new options target libc top label = libc top label ; changed = true ; } if ( host crosstool top = = null ) { / / default to the initial target crosstool top new options host crosstool top = crosstool top ; / / reset this , also , to maintain the invariant that host compiler is ignored if / / host crosstool top is unset new options host cpp compiler = cpp compiler ; changed = true ; } if ( changed ) { return new options ; } return this ; }


retrieve a snapshot of total requests , error count and error percentage this metrics should measure the actual health of a { @ link hystrix command } for that reason , the following are included : { @ link hystrix event type # success } { @ link hystrix event type # failure } { @ link hystrix event type # timeout } { @ link hystrix event type # thread pool rejected } { @ link hystrix event type # semaphore rejected } the following are not included in either attemptsfailures : { @ link hystrix event type # bad request } - this event denotes bad arguments to the command and not a problem with the command { @ link hystrix event type # short circuited } - this event measures a health problem in the past , not a problem with the current state { @ link hystrix event type # cancelled } - this event denotes a user - cancelled command it ' s not known if it would have been a success or failure , so it shouldn ' t count for either all fallback metrics { @ link hystrix event type # emit } - this event is not a terminal state for the command { @ link hystrix event type # collapsed } - this event is about the batching process , not the command execution

public health counts get health counts ( ) { return health counts stream get latest ( ) ; }


gets the { @ link dyld cache local symbols info }

public dyld cache local symbols info get local symbols info ( ) { return local symbols info ; }


spills all queued buffers on checkpoint start if barrier has already been received ( and reordered ) , spill only the overtaken buffers

public void checkpoint started ( checkpoint barrier barrier ) throws checkpoint exception { synchronized ( received buffers ) { channel state persister start persisting ( barrier get id ( ) , get inflight buffers unsafe ( barrier get id ( ) ) ) ; } }


exit a parse tree produced by the { @ code value expression default } labeled alternative in { @ link eql base parser # value expression }

void exit value expression default ( eql base parser value expression default context ctx ) ;


sets the image data of the { @ link texture } based on the { @ link pixmap } the texture must be bound for this to work if < code > dispose pixmap < code > is true , the pixmap will be disposed at the end of the method

public static void generate mip map ( int target , pixmap pixmap , int texture width , int texture height ) { if ( ! use h w mip map ) { generate mip map c p u ( target , pixmap , texture width , texture height ) ; return ; } if ( gdx app get type ( ) = = application type android | | gdx app get type ( ) = = application type web g l | | gdx app get type ( ) = = application type i o s ) { generate mip map g l e s 2 0 ( target , pixmap ) ; } else { generate mip map desktop ( target , pixmap , texture width , texture height ) ; } }


adds the given node at the given index as a child to this node

public void add node ( int index , g tree node node ) { swing run now ( ( ) - > do add node ( index , node ) ) ; }


public outer enum get outer enum ( ) { return outer enum ; }


returns { @ code true } if a character sequence contains no matching bmp characters equivalent to { @ code ! matches any of ( sequence ) } the default implementation iterates over the sequence , invoking { @ link # matches } for each character , until this returns { @ code true } or the end is reached

public boolean matches none of ( char sequence sequence ) { return index in ( sequence ) = = - 1 ; }


void set reactor ( nio reactor reactor ) { this reactor = reactor ; }


called before the rendering of all layers starts

protected void begin render ( ) { animated tiled map tile update animation base time ( ) ; batch begin ( ) ; }


gets the list of assigned user jar paths

public map < string , distributed cache distributed cache entry > get user artifacts ( ) { return user artifacts ; }


returns an immutable map containing the given entries , in order

public static < k , v > immutable map < k , v > of ( k k 1 , v v 1 , k k 2 , v v 2 , k k 3 , v v 3 ) { check entry not null ( k 1 , v 1 ) ; check entry not null ( k 2 , v 2 ) ; check entry not null ( k 3 , v 3 ) ; return regular immutable map create ( 3 , new object [ ] { k 1 , v 1 , k 2 , v 2 , k 3 , v 3 } ) ; }


get the specific external resource information by the resource name


builds an index of fields to their corresponding serializers for the new { @ link pojo serializer } for faster field serializer lookups

private static < t > map < field , type serializer < ? > > build new field serializers index ( pojo serializer < t > new pojo serializer ) { final field [ ] new fields = new pojo serializer get fields ( ) ; final type serializer < ? > [ ] new field serializers = new pojo serializer get field serializers ( ) ; check state ( new fields length = = new field serializers length ) ; int num fields = new fields length ; final map < field , type serializer < ? > > index = new hash map < > ( num fields ) ; for ( int i = 0 ; i < num fields ; i + + ) { index put ( new fields [ i ] , new field serializers [ i ] ) ; } return index ; }


public void start observer ( ) throws exception { int client port = port assignment unique ( ) ; string config = " server " + observer 1 + " = localhost : " + port assignment unique ( ) + " : " + client port + " : observer ; " + " localhost : " + port assignment unique ( ) ; main thread observer = new main thread ( observer 1 , client port , config ) ; observer start ( ) ; assert false ( client base wait for server up ( " 127 0 0 1 : " + client port , connection timeout ) , " observer was able to start by itself ! " ) ; }


protected result value printer get printer ( ) { return this printer ; }