this is a half - way method of turning this label into an immutable instance if the user has a type of " g html label " , they will see the deprecated warning on calls to set text ( ) if there are calls to set text ( ) after the initial value has been set by the ctor , a warning will be printed in the log

public void set text ( string text ) { if ( ! string utils is empty ( get text ( ) ) ) { msg warn ( this , " trying to set text on an immutable label ! current text : [ " + get text ( ) + " ] , new text : [ " + text + " ] " , reflection utilities create java filtered throwable ( ) ) ; return ; } super set text ( text ) ; }


reads the specified block of data , writing it into the cache

private long read block to cache ( long position , long length ) throws i o exception { boolean is last block = position + length = = end position | | length = = c length unset ; try { long resolved length = c length unset ; boolean is data source open = false ; if ( length ! = c length unset ) { / / if the length is specified , try to open the data source with a bounded request to avoid / / the underlying network stack requesting more data than required try { data spec bounded data spec = data spec build upon ( ) set position ( position ) set length ( length ) build ( ) ; resolved length = data source open ( bounded data spec ) ; is data source open = true ; } catch ( i o exception exception ) { if ( allow short content & & is last block & & data source exception is caused by position out of range ( exception ) ) { / / the length of the request exceeds the length of the content if we allow shorter / / content and are reading the last block , fall through and try again with an unbounded / / request to read up to the end of the content util close quietly ( data source ) ; } else { throw exception ; } } } if ( ! is data source open ) { / / either the length was unspecified , or we allow short content and our attempt to open the / / data source with the specified length failed throw if canceled ( ) ; data spec unbounded data spec = data spec build upon ( ) set position ( position ) set length ( c length unset ) build ( ) ; resolved length = data source open ( unbounded data spec ) ; } if ( is last block & & resolved length ! = c length unset ) { on request end position ( position + resolved length ) ; } int total bytes read = 0 ; int bytes read = 0 ; while ( bytes read ! = c result end of input ) { throw if canceled ( ) ; bytes read = data source read ( temporary buffer , / * offset = * / 0 , temporary buffer length ) ; if ( bytes read ! = c result end of input ) { on new bytes cached ( bytes read ) ; total bytes read + = bytes read ; } } if ( is last block ) { on request end position ( position + total bytes read ) ; } return total bytes read ; } finally { util close quietly ( data source ) ; } }


returns a json adapter equal to this json adapter , but that serializes nulls when encoding json

public final json adapter < t > serialize nulls ( ) { final json adapter < t > delegate = this ; return new json adapter < t > ( ) { @ override public @ nullable t from json ( json reader reader ) throws i o exception { return delegate from json ( reader ) ; } @ override public void to json ( json writer writer , @ nullable t value ) throws i o exception { boolean serialize nulls = writer get serialize nulls ( ) ; writer set serialize nulls ( true ) ; try { delegate to json ( writer , value ) ; } finally { writer set serialize nulls ( serialize nulls ) ; } } @ override boolean is lenient ( ) { return delegate is lenient ( ) ; } @ override public string to string ( ) { return delegate + " serialize nulls ( ) " ; } } ; }


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


this test sets up a scenario where the history files have already been moved to the " done " directory ( so the " intermediate " directory is empty ) , but then move to done ( ) is called again on the same history file it validates that the second move to done ( ) still succeeds rather than throws a file not found exception

public void test move to done already moved succeeds ( ) throws exception { history file manager test history file manager = new history file manager test ( ) ; long job timestamp = 1535436603000l ; string job = " job " + job timestamp + " 123456789 " ; string intermediate directory = " / " + uuid random u u i d ( ) ; string done directory = " / " + uuid random u u i d ( ) ; configuration conf = dfs cluster get configuration ( 0 ) ; conf set ( j h admin config mr history intermediate done dir , intermediate directory ) ; conf set ( j h admin config mr history done dir , done directory ) ; path intermediate history file path = new path ( intermediate directory + " / " + job + " jhist " ) ; path intermediate conf file path = new path ( intermediate directory + " / " + job + " conf xml " ) ; path done history file path = new path ( done directory + " / " + job history utils timestamp directory component ( job timestamp ) + " / 123456 / " + job + " jhist " ) ; path done conf file path = new path ( done directory + " / " + job history utils timestamp directory component ( job timestamp ) + " / 123456 / " + job + " conf xml " ) ; dfs cluster get file system ( ) create new file ( done history file path ) ; dfs cluster get file system ( ) create new file ( done conf file path ) ; history file manager service init ( conf ) ; job index info job index info = new job index info ( ) ; job index info set job id ( type converter to yarn ( job i d for name ( job ) ) ) ; job index info set finish time ( job timestamp ) ; history file info info = history file manager get history file info ( intermediate history file path , intermediate conf file path , null , job index info , false ) ; info move to done ( ) ; assert assert false ( info is move pending ( ) ) ; assert assert equals ( done history file path to string ( ) , info get history file ( ) to uri ( ) get path ( ) ) ; assert assert equals ( done conf file path to string ( ) , info get conf file ( ) to uri ( ) get path ( ) ) ; }


this should be executed if the thread - pool executing this action rejected the execution the default implementation forwards to { @ link # on failure ( exception ) }

public void on rejection ( exception e ) { on failure ( e ) ; }


find the fields constant that matches field id , throwing an exception if it is not found

public static fields find by thrift id or throw ( int field id ) { fields fields = find by thrift id ( field id ) ; if ( fields = = null ) throw new illegal argument exception ( " field " + field id + " doesn ' t exist ! " ) ; return fields ; }


public string sequence builder add value ( string value ) { values add ( value ) ; return this ; }


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


public < t > param converter < t > get converter ( final class < t > raw type , final type generic type , final annotation [ ] annotations ) { if ( optional class equals ( raw type ) ) { final list < class type pair > ctps = reflection helper get type argument and class ( generic type ) ; final class type pair ctp = ( ctps size ( ) = = 1 ) ? ctps get ( 0 ) : null ; if ( ctp = = null | | ctp raw class ( ) = = string class ) { return new param converter < t > ( ) { @ override public t from string ( final string value ) { return raw type cast ( optional of nullable ( value ) ) ; } @ override public string to string ( final t value ) { return value to string ( ) ; } } ; } for ( param converter provider provider : providers get providers ( manager , param converter provider class ) ) { final param converter < ? > converter = provider get converter ( ctp raw class ( ) , ctp type ( ) , annotations ) ; if ( converter ! = null ) { return new param converter < t > ( ) { @ override public t from string ( final string value ) { return raw type cast ( optional of nullable ( value ) map ( s - > converter from string ( value ) ) ) ; } @ override public string to string ( final t value ) { return value to string ( ) ; } } ; } } } return null ; }


guard method for inline caching : checks the receiver ' s class is the same as the cached class

static boolean check class ( class < ? > clazz , object receiver ) { return receiver get class ( ) = = clazz ; }


perform a scan within the specified base packages , returning the registered bean definitions this method does not register an annotation config processor but rather leaves this up to the caller

protected set < bean definition holder > do scan ( string base packages ) { assert not empty ( base packages , " at least one base package must be specified " ) ; set < bean definition holder > bean definitions = new linked hash set < > ( ) ; for ( string base package : base packages ) { set < bean definition > candidates = find candidate components ( base package ) ; for ( bean definition candidate : candidates ) { scope metadata scope metadata = this scope metadata resolver resolve scope metadata ( candidate ) ; candidate set scope ( scope metadata get scope name ( ) ) ; string bean name = this bean name generator generate bean name ( candidate , this registry ) ; if ( candidate instanceof abstract bean definition ) { post process bean definition ( ( abstract bean definition ) candidate , bean name ) ; } if ( candidate instanceof annotated bean definition ) { annotation config utils process common definition annotations ( ( annotated bean definition ) candidate ) ; } if ( check candidate ( bean name , candidate ) ) { bean definition holder definition holder = new bean definition holder ( candidate , bean name ) ; definition holder = annotation config utils apply scoped proxy mode ( scope metadata , definition holder , this registry ) ; bean definitions add ( definition holder ) ; register bean definition ( definition holder , this registry ) ; } } } return bean definitions ; }


return the number of steps of this summation

long get steps ( ) { return e get steps ( ) ; }


writes the specified { @ code message } to all { @ link channel } s in this group if the specified { @ code message } is an instance of { @ link byte buf } , it is automatically { @ linkplain byte buf # duplicate ( ) duplicated } to avoid a race condition the same is true for { @ link byte buf holder } please note that this operation is asynchronous as { @ link channel # write ( object ) } is

channel group future write ( object message ) ;


public static signature [ ] get app signatures ( final string package name ) { if ( utils bridge is space ( package name ) ) return null ; try { package manager pm = utils get app ( ) get package manager ( ) ; if ( build version sdk int > = build version codes p ) { package info pi = pm get package info ( package name , package manager get signing certificates ) ; if ( pi = = null ) return null ; signing info signing info = pi signing info ; if ( signing info has multiple signers ( ) ) { return signing info get apk contents signers ( ) ; } else { return signing info get signing certificate history ( ) ; } } else { package info pi = pm get package info ( package name , package manager get signatures ) ; if ( pi = = null ) return null ; return pi signatures ; } } catch ( package manager name not found exception e ) { e print stack trace ( ) ; return null ; } }


returns the attribute whose name is { @ code attr name } , or null if not found

attribute get attribute by name maybe ( string attr name ) { integer i = get attribute index ( attr name ) ; return i = = null ? null : attributes get ( i ) ; }


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

public group prop multiple supported attribute same name model view model on visibility changed ( on model visibility changed listener < group prop multiple supported attribute same name model view model , group prop multiple supported attribute same name model view > listener ) { on mutation ( ) ; this on model visibility changed listener epoxy generated model = listener ; return this ; }


select does match necessarily escaping the decoded value is used in the path

public void select name necessary escaping ( ) throws i o exception { json reader options options = json reader options of ( " \ n " , " \ u 0 0 0 0 " , " \ " " ) ; json reader reader = new reader ( " { \ " \ \ n \ " : 5 , \ " \ \ u 0 0 0 0 \ " : 5 , \ " \ \ \ " \ " : 5 } " ) ; reader begin object ( ) ; assert equals ( 0 , reader select name ( options ) ) ; assert equals ( 5 , reader next int ( ) ) ; assert equals ( " $ \ n " , reader get path ( ) ) ; assert equals ( 1 , reader select name ( options ) ) ; assert equals ( 5 , reader next int ( ) ) ; assert equals ( " $ \ u 0 0 0 0 " , reader get path ( ) ) ; assert equals ( 2 , reader select name ( options ) ) ; assert equals ( 5 , reader next int ( ) ) ; assert equals ( " $ \ " " , reader get path ( ) ) ; reader end object ( ) ; }


updates a pet in the store with form data

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


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


two - arg method with the first param nullable

public void nullable normal ( @ nullable decl string first , integer second ) { react to null parameters ( first , second ) ; }


public void unbind ( final shader program shader ) { unbind ( shader , null ) ; }


check if this and another vertex " agree " this doesn ' t mean they ' re equal , but that they share a subtable , and the defined bits of their context blocks agree

public boolean matches ( vertex that ) { if ( ! this subtable equals ( that subtable ) ) { return false ; } if ( this context combine ( that context ) = = null ) { return false ; } return true ; }


return the spring configuration that contains application beans including the ones detected by { @ link web http handler builder # application context }

protected application context create application context ( ) { annotation config application context context = new annotation config application context ( ) ; class < ? > [ ] config classes = get config classes ( ) ; assert not empty ( config classes , " no spring configuration provided through get config classes ( ) " ) ; context register ( config classes ) ; return context ; }


public void set user icon ( int handle , bitmap icon ) { try { m service set user icon ( handle , icon ) ; } catch ( remote exception re ) { log w ( tag , " could not set the user icon " , re ) ; } }


returns the population covariance of the values the count must be non - zero this is guaranteed to return zero if the dataset contains a single pair of finite values it is not guaranteed to return zero when the dataset consists of the same pair of values multiple times , due to numerical errors < h 3 > non - finite values < h 3 > if the dataset contains any non - finite values ( { @ link double # positive infinity } , { @ link double # negative infinity } , or { @ link double # na n } ) then the result is { @ link double # na n }

public double population covariance ( ) { check state ( count ( ) ! = 0 ) ; return sum of products of deltas / count ( ) ; }


public open a p i get open a p i ( ) { return specification ; }


{ @ inherit doc } use { @ code get an increment ( ) } on { @ link # open operations } so that on invocation 1 it returns 0 the caller will know that this is the first invocation

public long stream opened ( ) { return open operations get and increment ( ) ; }


return the request attributes currently bound to the thread

public static request attributes get request attributes ( ) { request attributes attributes = request attributes holder get ( ) ; if ( attributes = = null ) { attributes = inheritable request attributes holder get ( ) ; } return attributes ; }


binary operators don ' t yet adopt the return value with compound assignment

public void test binary compound assignment prefix ( ) { assert equals ( ( byte ) 6 , exec ( " def x = 5l ; return ( byte ) ( + + x ) ; " ) ) ; assert equals ( ( short ) 6 , exec ( " def x = 5l ; return ( short ) ( + + x ) ; " ) ) ; assert equals ( ( char ) 6 , exec ( " def x = 5l ; return ( char ) ( + + x ) ; " ) ) ; assert equals ( 6 , exec ( " def x = 5l ; return ( int ) ( + + x ) ; " ) ) ; assert equals ( 6f , exec ( " def x = 5l ; return ( float ) ( + + x ) ; " ) ) ; assert equals ( 6l , exec ( " def x = 5l ; return ( long ) ( + + x ) ; " ) ) ; assert equals ( 6d , exec ( " def x = 5l ; return ( double ) ( + + x ) ; " ) ) ; }


this implementation compares the underlying class path locations

public boolean equals ( object obj ) { if ( obj = = this ) { return true ; } if ( obj instanceof class path resource ) { class path resource other res = ( class path resource ) obj ; class loader this loader = this class loader ; class loader other loader = other res class loader ; return ( this path equals ( other res path ) & & this loader equals ( other loader ) & & this clazz equals ( other res clazz ) ) ; } return false ; }


return the map with attributes associated with the web socket session on the server side the map can be populated initially through a { @ link org springframework web socket server handshake interceptor handshake interceptor } on the client side the map can be populated via { @ link org springframework web socket client web socket client web socket client } handshake methods

map < string , object > get attributes ( ) ;


returns any registered new provider name for the old nameold owner pair

public static string get mapped owner ( string old owner , string old name ) { string key = get key ( old owner , old name ) ; return old owner map get ( key ) ; }


open a file for reading through a builder api ultimately calls { @ link # open ( path handle , int ) } unless a subclass executes the open command differently if path handles are unsupported , this may fail in the { @ code f s data input stream builder build ( ) } command , rather than in this { @ code open file ( ) } operation

public future data input stream builder open file ( path handle path handle ) throws i o exception , unsupported operation exception { return create data input stream builder ( this , path handle ) get this builder ( ) ; }


set the serialization schema used to serialize objects to be added as payloads of pub sub messages

public < in > project name builder < in > with serialization schema ( serialization schema < in > deserialization schema ) { return new pub sub sink builder < > ( deserialization schema ) ; }


open a new { @ link file descriptor } for the given { @ link file }

public static file descriptor from ( file file ) throws i o exception { return from ( check not null ( file , " file " ) get path ( ) ) ; }


returns the string path of a dwarf entry always returns a name for the passed - in entry , but you should probably only use this for entries that are { @ link d i e aggregate # is named type ( ) }

private d w a r f name info get d w a r f name info ( d i e aggregate diea , d w a r f name info local root d n i ) { d w a r f name info parent d n i = local root d n i ; d i e aggregate decl parent = diea get decl parent ( ) ; if ( ( decl parent ! = null ) & & decl parent get tag ( ) ! = d w a r f tag dw tag compile unit ) { parent d n i = lookup d n i by offset ( decl parent get offset ( ) ) ; if ( parent d n i = = null ) { parent d n i = get d w a r f name info ( decl parent , local root d n i ) ; if ( parent d n i ! = null ) { cache d n i by offset ( decl parent get offset ( ) , parent d n i ) ; } } } string name = get entry name ( diea ) ; / / mangled names can occur in linkage attributes or in the regular name attribute if ( name ! = null & & name contains ( " z " ) / * mangler start seq * / & & ! name starts with ( " global " ) / * compiler generated , don ' t demangle as they tend to conflict with existing names * / ) { list < string > nestings = ensure safe name lengths ( d w a r f util parse mangled nestings ( name ) ) ; if ( ! nestings is empty ( ) ) { name = nestings remove ( nestings size ( ) - 1 ) ; if ( parent d n i = = local root d n i & & ! nestings is empty ( ) ) { parent d n i = d w a r f name info from list ( local root d n i , nestings ) ; } } } / / if namespace info got squashed due to compiler / linker flags , try to / / dig it up from the mangled linkage info that might be present in our children if ( local root d n i equals ( parent d n i ) ) { list < string > nestings = d w a r f util find linkage name in children ( diea get head fragment ( ) ) ; if ( ! nestings is empty ( ) ) { nestings remove ( nestings size ( ) - 1 ) ; parent d n i = d w a r f name info from list ( local root d n i , nestings ) ; } } if ( name = = null ) { / / check to see if there is a single inbound typedef that we can / / steal its name d i e aggregate referring typedef = d w a r f util get referring typedef ( diea ) ; if ( referring typedef ! = null ) { return get d w a r f name info ( referring typedef , local root d n i ) ; } } boolean is anon = false ; if ( name = = null ) { switch ( diea get tag ( ) ) { case d w a r f tag dw tag base type : name = get anon base type name ( diea ) ; is anon = true ; break ; case d w a r f tag dw tag enumeration type : name = get anon enum name ( diea ) ; is anon = true ; break ; case d w a r f tag dw tag subroutine type : / / unnamed subroutines ( c func ptrs ) / / see { @ link # is anon subroutine ( data type ) } name = " anon subr " ; is anon = true ; break ; case d w a r f tag dw tag lexical block : name = d w a r f util get lexical block name ( diea ) ; break ; case d w a r f tag dw tag formal parameter : name = " param " + d w a r f util get my position in parent ( diea get head fragment ( ) ) ; is anon = true ; break ; case d w a r f tag dw tag subprogram : case d w a r f tag dw tag inlined subroutine : if ( decl parent ! = null & & decl parent is structure type ( ) & & diea get bool ( d w a r f attribute dw at artificial , false ) ) { name = parent d n i get name ( ) ; } else { name = " anon func " ; is anon = true ; } break ; default : if ( decl parent ! = null & & decl parent is name space container ( ) ) { name = d w a r f util get anon name for me from parent context 2 ( diea ) ; } break ; } } / / name was not found if ( is anon d w a r f name ( name ) ) { name = create anon name ( " anon " + d w a r f util get container type name ( diea ) , diea ) ; is anon = true ; } string orig name = is anon ? null : name ; string working name = ensure safe name length ( name ) ; switch ( diea get tag ( ) ) { / / fixup dwarf entries that are related to ghidra symbols case d w a r f tag dw tag subroutine type : case d w a r f tag dw tag subprogram : case d w a r f tag dw tag inlined subroutine : working name = symbol utilities replace invalid chars ( working name , false ) ; break ; } d w a r f name info result = parent d n i create child ( orig name , working name , d w a r f util get symbol type from d i e ( diea ) ) ; return result ; }


returns the sum of { @ code a } and { @ code b } unless it would overflow or underflow in which case { @ code integer max value } or { @ code integer min value } is returned , respectively

public static int saturated add ( int a , int b ) { return ints saturated cast ( ( long ) a + b ) ; }


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


function that verifies whether the edge to be removed is part of the sssp or not if it is , the src vertex will be invalidated

public static boolean is in s s s p ( final edge < long , double > edge to be removed , data set < edge < long , double > > edges in s s s p ) throws exception { return edges in s s s p filter ( new filter function < edge < long , double > > ( ) { @ override public boolean filter ( edge < long , double > edge ) throws exception { return edge equals ( edge to be removed ) ; } } ) count ( ) > 0 ; }


creates get api key request for given realm and user name

public static get api key request using realm and user name ( string realm name , string user name ) { return new get api key request ( realm name , user name , null , null , false ) ; }


set a description of the resource that this bean definition came from ( for the purpose of showing context in case of errors )

public void set resource description ( @ nullable string resource description ) { this resource = ( resource description ! = null ? new descriptive resource ( resource description ) : null ) ; }


return a command for determining if process with specified pid is alive

public static string [ ] get check process is alive command ( string pid ) { return get signal kill command ( 0 , pid ) ; }


invokes a client protocol method determines the target nameservice using the block pool id re - throws exceptions generated by the remote rpc call as either remote exception or i o exception

public object invoke single block pool ( final string bp id , remote method method ) throws i o exception { string ns id = get nameservice for block pool id ( bp id ) ; return invoke single ( ns id , method ) ; }


transfer data from a file channel to a socket output stream

public void transfer to socket fully ( @ nullable fs volume spi volume , socket output stream sock out , file channel file ch , long position , int count , long writable wait time , long writable transfer time ) throws i o exception { final long begin = profiling event hook before file io ( volume , transfer , count ) ; try { fault injector event hook before file io ( volume , transfer , count ) ; sock out transfer to fully ( file ch , position , count , wait time , transfer time ) ; profiling event hook after file io ( volume , transfer , begin , count ) ; } catch ( exception e ) { string em = e get message ( ) ; if ( em ! = null ) { if ( ! em starts with ( " broken pipe " ) & & ! em starts with ( " connection reset " ) ) { on failure ( volume , begin ) ; } } else { on failure ( volume , begin ) ; } throw e ; } }


initializes the write for the log aggregation controller in the rolling case it sets up modifies checksum and meta files if needed

private pair < path , boolean > initialize writer in rolling ( final path remote log file , final application id app id , final string node id ) throws exception { boolean created new = false ; path aggregated log file = null ; / / check uuid / / if we can not find uuid , we would load the uuid / / from previous aggregated log files , and at the same / / time , we would delete any aggregated log files which / / has invalid uuid if ( uuid = = null ) { uuid = load u u i d from log file ( fc , remote log file get parent ( ) , app id , node id ) ; } path current remote log file = get current remote log file ( fc , remote log file get parent ( ) , node id ) ; / / check checksum file boolean overwrite check sum = true ; remote log check sum file = new path ( remote log file get parent ( ) , ( remote log file get name ( ) + check sum file suffix ) ) ; if ( fc util ( ) exists ( remote log check sum file ) ) { / / if the checksum file exists , we should reset cached / / indexed logs meta indexed logs meta get log metas ( ) clear ( ) ; if ( current remote log file ! = null ) { f s data input stream checksum file input stream = null ; try { checksum file input stream = fc open ( remote log check sum file ) ; int name length = checksum file input stream read int ( ) ; byte [ ] b = new byte [ name length ] ; int actual length = checksum file input stream read ( b ) ; if ( actual length = = name length ) { string recovered log file = new string ( b , charset for name ( " utf - 8 " ) ) ; if ( recovered log file equals ( current remote log file get name ( ) ) ) { overwrite check sum = false ; long end index = checksum file input stream read long ( ) ; indexed logs meta recovered logs meta = load indexed logs meta ( current remote log file , end index , app id ) ; if ( recovered logs meta ! = null ) { indexed logs meta = recovered logs meta ; } } } } finally { i o utils cleanup with logger ( log , checksum file input stream ) ; } } } / / check whether we need roll over old logs if ( current remote log file = = null | | is rollover ( fc , current remote log file ) ) { indexed logs meta get log metas ( ) clear ( ) ; overwrite check sum = true ; aggregated log file = new path ( remote log file get parent ( ) , remote log file get name ( ) + " " + sys clock get time ( ) ) ; fs data o stream = fc create ( aggregated log file , enum set of ( create flag create , create flag overwrite ) , new options create opts [ ] { } ) ; / / writes the uuid fs data o stream write ( uuid ) ; fs data o stream flush ( ) ; created new = true ; } else { aggregated log file = current remote log file ; fs data o stream = fc create ( current remote log file , enum set of ( create flag create , create flag append ) , new options create opts [ ] { } ) ; } / / recreate checksum file if needed before aggregate the logs if ( overwrite check sum ) { long current aggregated log file length ; if ( created new ) { current aggregated log file length = 0 ; } else { current aggregated log file length = fc get file status ( aggregated log file ) get len ( ) ; } f s data output stream checksum file output stream = null ; try { checksum file output stream = fc create ( remote log check sum file , enum set of ( create flag create , create flag overwrite ) , new options create opts [ ] { } ) ; string file name = aggregated log file get name ( ) ; checksum file output stream write int ( file name length ( ) ) ; checksum file output stream write ( file name get bytes ( charset for name ( " utf - 8 " ) ) ) ; checksum file output stream write long ( current aggregated log file length ) ; checksum file output stream flush ( ) ; } finally { i o utils cleanup with logger ( log , checksum file output stream ) ; } } return pair of ( aggregated log file , created new ) ; }


returns the internal of name of the super class ( see { @ link type # get internal name ( ) } ) for interfaces , the super class is { @ link object }

public string get super name ( ) { / / super class is after the access flags and this class fields ( 2 bytes each ) return read class ( header + 4 , new char [ max string length ] ) ; }


enter a parse tree produced by the { @ code numeric literal } labeled alternative in { @ link sql base parser # constant }

void enter numeric literal ( sql base parser numeric literal context ctx ) ;


the number of shards on this node that will not be eventually relocated

public int number of owning shards ( ) { return shards size ( ) - relocating shards size ( ) ; }


returns the maximum age of this { @ link cookie } in seconds or { @ link long # min value } if unspecified


returns the < a href = " http : en wikipedia orgwiki arithmetic mean " > arithmetic mean of { @ code values } if these values are a sample drawn from a population , this is also an unbiased estimator of the arithmetic mean of the population

public static double mean ( double values ) { check argument ( values length > 0 , " cannot take mean of 0 values " ) ; long count = 1 ; double mean = check finite ( values [ 0 ] ) ; for ( int index = 1 ; index < values length ; + + index ) { check finite ( values [ index ] ) ; count + + ; / / art of computer programming vol 2 , knuth , 4 2 2 , ( 15 ) mean + = ( values [ index ] - mean ) / count ; } return mean ; }


subclasses should call this method to create a new prototype instance

protected object new prototype instance ( ) throws beans exception { if ( logger is debug enabled ( ) ) { logger debug ( " creating new instance of bean ' " + get target bean name ( ) + " ' " ) ; } return get bean factory ( ) get bean ( get target bean name ( ) ) ; }


register a { @ link view resolver composite } that contains a chain of view resolvers to use for view resolution by default this resolver is ordered at 0 unless content negotiation view resolution is used in which case the order is raised to { @ link org springframework core ordered # highest precedence ordered highest precedence } if no other resolvers are configured , { @ link view resolver composite # resolve view name ( string , locale ) } returns null in order to allow other potential { @ link view resolver } beans to resolve views

public view resolver mvc view resolver ( @ qualifier ( " mvc content negotiation manager " ) content negotiation manager content negotiation manager ) { view resolver registry registry = new view resolver registry ( content negotiation manager , this application context ) ; configure view resolvers ( registry ) ; if ( registry get view resolvers ( ) is empty ( ) & & this application context ! = null ) { string [ ] names = bean factory utils bean names for type including ancestors ( this application context , view resolver class , true , false ) ; if ( names length = = 1 ) { registry get view resolvers ( ) add ( new internal resource view resolver ( ) ) ; } } view resolver composite composite = new view resolver composite ( ) ; composite set order ( registry get order ( ) ) ; composite set view resolvers ( registry get view resolvers ( ) ) ; if ( this application context ! = null ) { composite set application context ( this application context ) ; } if ( this servlet context ! = null ) { composite set servlet context ( this servlet context ) ; } return composite ; }


returns true if null is a legal value for this dependency

public boolean is nullable ( ) { return nullable ; }


return the additional ( undeclared ) property

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


create a loop this automatically adjusts connectivity

public void create loop ( vector 2 [ ] vertices ) { float [ ] verts = new float [ vertices length * 2 ] ; for ( int i = 0 , j = 0 ; i < vertices length * 2 ; i + = 2 , j + + ) { verts [ i ] = vertices [ j ] x ; verts [ i + 1 ] = vertices [ j ] y ; } jni create loop ( addr , verts , 0 , verts length / 2 ) ; is looped = true ; }


public string get cluster i d ( ) { return cluster i d ; }


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


public boolean merge ( ) throws cancelled exception { return merge ( task monitor adapter dummy monitor ) ; }


sets whether or not notifications posted to this channel can interrupt the user in { @ link android app notification manager policy # interruption filter priority } mode only modifiable by the system and notification ranker

public channel config set bypass dnd ( boolean bypass dnd ) { if ( build version sdk int > = build version codes o ) { m notification channel set bypass dnd ( bypass dnd ) ; } return this ; }


processes the trailers and status from the server

protected void inbound trailers received ( metadata trailers , status status ) { check not null ( status , " status " ) ; check not null ( trailers , " trailers " ) ; if ( status reported ) { log log ( level info , " received trailers on closed stream : \ n { 1 } \ n { 2 } " , new object [ ] { status , trailers } ) ; return ; } stats trace ctx client inbound trailers ( trailers ) ; transport report status ( status , false , trailers ) ; }


always prefer a direct buffer when it ' s pooled , so that we reduce the number of memory copies in { @ link open ssl engine }

private byte buf allocate ( channel handler context ctx , int capacity ) { byte buf allocator alloc = ctx alloc ( ) ; if ( engine type wants direct buffer ) { return alloc direct buffer ( capacity ) ; } else { return alloc buffer ( capacity ) ; } }


protected void prepare ( configuration conf , int num data units , int num parity units , int [ ] erased data indexes , int [ ] erased parity indexes , boolean using fixed data ) { this conf = conf ! = null ? conf : new configuration ( ) ; this num data units = num data units ; this num parity units = num parity units ; this erased data indexes = erased data indexes ! = null ? erased data indexes : new int [ ] { 0 } ; this erased parity indexes = erased parity indexes ! = null ? erased parity indexes : new int [ ] { 0 } ; this using fixed data = using fixed data ; if ( using fixed data ) { prepare fixed data ( ) ; } }


public string get unparsed default value ( ) { return option annotation default value ( ) ; }


sets up the fixture , for example , open a network connection this method is called before a test is executed

public void set up ( ) throws exception { program = build program ( ) ; }


advances the time for the given nfa to the given timestamp this means that no more events with timestamp < b > lower < b > than the given timestamp should be passed to the nfa , this can lead to pruning and timeouts

private void advance time ( n f a state nfa state , long timestamp ) throws exception { try ( shared buffer accessor < in > shared buffer accessor = partial matches get accessor ( ) ) { collection < tuple 2 < map < string , list < in > > , long > > timed out = nfa advance time ( shared buffer accessor , nfa state , timestamp ) ; if ( ! timed out is empty ( ) ) { process timed out sequences ( timed out ) ; } } }


public void prepare ( ) { check service ( ) ; check service interface ( ) ; this skeleton = new hessian skeleton ( get proxy for service ( ) , get service interface ( ) ) ; }


public void add pet test ( ) { pet pet = null ; / / api add pet ( pet ) ; / / todo : test validations }


should guard by { @ link v activity manager service # m process names }

public process record find process locked ( string process name , int uid ) { return m process names get ( process name , uid ) ; }


clears all current values from the range map and resets the default value

public void clear ( ) { map remove range ( 0 , long max value ) ; map put int ( 0 , default value ) ; }


public synchronized boolean is running ( ) { return running ; }


sets type of queue processing for tasks for loading and displaying images < br > default value - { @ link queue processing type # fifo }

public builder tasks processing order ( queue processing type tasks processing type ) { if ( task executor ! = null | | task executor for cached images ! = null ) { l w ( warning overlap executor ) ; } this tasks processing type = tasks processing type ; return this ; }


extracts an avro { @ link schema } from a { @ link specific record } we do this by creating an instance of the class using the zero - argument constructor and calling { @ link specific record # get schema ( ) } on it

private static optional < schema > try extract avro schema via instance ( class < ? > type ) { try { specific record instance = ( specific record ) type new instance ( ) ; return optional of nullable ( instance get schema ( ) ) ; } catch ( instantiation exception | illegal access exception e ) { log warn ( " could not extract schema from avro - generated specific record class { } : { } " , type , e ) ; return optional empty ( ) ; } }


get userlogout : logs out current logged in user session

default response entity < void > logout user ( ) { return get delegate ( ) logout user ( ) ; }


returns the available xcode versions from { @ code available xcodes }

public iterable < xcode version rule data > get available versions ( ) { return available xcodes ; }


create a container - managed extended entity manager proxy

public static entity manager create container managed entity manager ( entity manager factory emf , @ nullable map < ? , ? > properties , boolean synchronized with transaction ) { assert not null ( emf , " entity manager factory must not be null " ) ; if ( emf instanceof entity manager factory info ) { entity manager factory info emf info = ( entity manager factory info ) emf ; entity manager raw entity manager = emf info create native entity manager ( properties ) ; return create proxy ( raw entity manager , emf info , true , synchronized with transaction ) ; } else { entity manager raw entity manager = ( ! collection utils is empty ( properties ) ? emf create entity manager ( properties ) : emf create entity manager ( ) ) ; return create proxy ( raw entity manager , null , null , null , null , true , synchronized with transaction ) ; } }


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

public static update or delete executor delete all async ( final class < ? > model class , final string conditions ) { final update or delete executor executor = new update or delete executor ( ) ; runnable runnable = new runnable ( ) { @ override public void run ( ) { synchronized ( lite pal support class ) { final int rows affected = delete all ( model class , conditions ) ; if ( executor get listener ( ) ! = null ) { operator get handler ( ) post ( new runnable ( ) { @ override public void run ( ) { executor get listener ( ) on finish ( rows affected ) ; } } ) ; } } } } ; executor submit ( runnable ) ; return executor ; }


generates a xml response that describe the ec2 instances todo : org elasticsearch discovery ec 2 amazon e c 2 fixture uses pretty much the same code we should dry up that test fixture

static byte [ ] generate describe instances response ( list < instance > instances ) { final x m l output factory xml output factory = x m l output factory new factory ( ) ; xml output factory set property ( x m l output factory is repairing namespaces , true ) ; final string writer out = new string writer ( ) ; x m l stream writer sw ; try { sw = xml output factory create x m l stream writer ( out ) ; sw write start document ( ) ; string namespace = " http : / / ec 2 amazonaws com / doc / 2013 - 02 - 01 / " ; sw set default namespace ( namespace ) ; sw write start element ( x m l constants default ns prefix , " describe instances response " , namespace ) ; { sw write start element ( " request id " ) ; sw write characters ( uuid random u u i d ( ) to string ( ) ) ; sw write end element ( ) ; sw write start element ( " reservation set " ) ; { for ( instance instance : instances ) { sw write start element ( " item " ) ; { sw write start element ( " reservation id " ) ; sw write characters ( uuid random u u i d ( ) to string ( ) ) ; sw write end element ( ) ; sw write start element ( " instances set " ) ; { sw write start element ( " item " ) ; { sw write start element ( " instance id " ) ; sw write characters ( instance get instance id ( ) ) ; sw write end element ( ) ; sw write start element ( " image id " ) ; sw write characters ( instance get image id ( ) ) ; sw write end element ( ) ; sw write start element ( " instance state " ) ; { sw write start element ( " code " ) ; sw write characters ( " 16 " ) ; sw write end element ( ) ; sw write start element ( " name " ) ; sw write characters ( " running " ) ; sw write end element ( ) ; } sw write end element ( ) ; sw write start element ( " private dns name " ) ; sw write characters ( instance get private dns name ( ) ) ; sw write end element ( ) ; sw write start element ( " dns name " ) ; sw write characters ( instance get public dns name ( ) ) ; sw write end element ( ) ; sw write start element ( " instance type " ) ; sw write characters ( " m 1 medium " ) ; sw write end element ( ) ; sw write start element ( " placement " ) ; { sw write start element ( " availability zone " ) ; sw write characters ( " use - east - 1e " ) ; sw write end element ( ) ; sw write empty element ( " group name " ) ; sw write start element ( " tenancy " ) ; sw write characters ( " default " ) ; sw write end element ( ) ; } sw write end element ( ) ; sw write start element ( " private ip address " ) ; sw write characters ( instance get private ip address ( ) ) ; sw write end element ( ) ; sw write start element ( " ip address " ) ; sw write characters ( instance get public ip address ( ) ) ; sw write end element ( ) ; sw write start element ( " tag set " ) ; for ( tag tag : instance get tags ( ) ) { sw write start element ( " item " ) ; { sw write start element ( " key " ) ; sw write characters ( tag get key ( ) ) ; sw write end element ( ) ; sw write start element ( " value " ) ; sw write characters ( tag get value ( ) ) ; sw write end element ( ) ; } sw write end element ( ) ; } sw write end element ( ) ; } sw write end element ( ) ; } sw write end element ( ) ; } sw write end element ( ) ; } sw write end element ( ) ; } sw write end element ( ) ; sw write end document ( ) ; sw flush ( ) ; } } catch ( exception e ) { throw new runtime exception ( e ) ; } return out to string ( ) get bytes ( utf 8 ) ; }


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

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


returns a string to publish : ether ' value prefix ' ' val ' or ' val '

public string get value ( long val ) { if ( this value prefix ! = null ) { return string format ( " % d % d " , this value prefix , val ) ; } return string format ( " % d " , val ) ; }


creates a library to link with the specified object files

public static library to link new input library ( artifact library , artifact category category , string library identifier , iterable < artifact > object files , lto compilation context lto compilation context , immutable map < artifact , lto backend artifacts > shared non lto backends , boolean must keep debug ) { return new input library ( library , category , library identifier , object files , lto compilation context , shared non lto backends , must keep debug , / * disable whole archive = * / false ) ; }


returns the rule that corresponds to a particular build target name useful for walking through the dependency graph of a target fails if the target is not a rule

public rule get rule ( string target name ) { return ( rule ) targets get ( target name ) ; }


this is the set of actions to perform when verifying the file actually was created with the s 3guard committer , the file doesn ' t come into existence ; a different set of assertions must be checked

public void test 030 post creation assertions ( ) throws throwable { s 3 a file system fs = get file system ( ) ; contract test utils assert path exists ( fs , " huge file " , hugefile ) ; file status status = fs get file status ( hugefile ) ; contract test utils assert is file ( hugefile , status ) ; assert equals ( " file size in " + status , filesize , status get len ( ) ) ; }


called when a load encounters an error note : there is guaranteed to be a memory barrier between { @ link loadable # load ( ) } exiting and this callback being called

load error action on load error ( t loadable , long elapsed realtime ms , long load duration ms , i o exception error , int error count ) ;


sets the concurrency level of the caches

public builder set concurrency level ( int concurrency level ) { this concurrency level = concurrency level ; return this ; }


get the cumulative load over a time interval

r l e sparse resource allocation get cumulative load over time ( long start , long end ) throws planning exception ;


checks whether the highlight thickness has changed

public boolean is highlight thickness changed ( final int thickness ) { return highlight thickness ! = thickness ; }


press a key on the keyboard that isn ' t text please see { @ link org openqa selenium keys } for an exhaustive list of recognized pressable keys if < code > key to press < code > is a sequence of characters , different driver implementations may choose to throw an exception or to read only the first character in the sequence

void press key ( char sequence key to press ) ;


do a geo search using the address as the query

final void search map ( string address ) { launch intent ( new intent ( intent action view , uri parse ( " geo : 0 , 0 ? q = " + uri encode ( address ) ) ) ) ; }


tells whether a constructor or destructor is present

public boolean has constructor or destructor ( ) { return constructor or destructor present ; }


static utility to parse a field of type date from a byte sequence that represents text characters ( such as when read from a file stream )

public static final date parse field ( byte [ ] bytes , int start pos , int length ) { return parse field ( bytes , start pos , length , ( char ) 0xffff ) ; }


apply an operation to all values of a remote iterator if the iterator is an i o statistics source returning a non - null set of statistics , and this classes log is set to debug , then the statistics of the operation are evaluated and logged at debug the number of entries processed is returned , as it is useful to know this , especially during tests or when reporting values to users this does not close the iterator afterwards

public static < t > long foreach ( remote iterator < t > source , consumer raising i o e < ? super t > consumer ) throws i o exception { long count = 0 ; try { while ( source has next ( ) ) { count + + ; consumer accept ( source next ( ) ) ; } / / maybe log the results log i o statistics at debug ( log , " remote iterator statistics : { } " , source ) ; } finally { if ( source instanceof closeable ) { / / source is closeable , so close i o utils cleanup with logger ( log , ( closeable ) source ) ; } } return count ; }


a version of { @ link # external ( context , string ) } that should be used when you know the identifier is a group id important : this will throw an exception if the group id you ' re using could have been migrated if you ' re dealing with inbound data , you should be using { @ link # external possibly migrated group ( context , group id ) } , or checking the database before calling this method

public static @ non null recipient external group exact ( @ non null context context , @ non null group id group id ) { return recipient resolved ( database factory get recipient database ( context ) get or insert from group id ( group id ) ) ; }


create a builder with the status code and headers of the given response

static body builder from ( server response other ) { return new default server response builder ( other ) ; }


detects , creates , and returns the appropriate { @ link abstract msf } object found for the filename given

public static abstract msf parse ( string filename , pdb reader options pdb options , task monitor monitor ) throws i o exception , pdb exception , cancelled exception { objects require non null ( filename , " filename cannot be null " ) ; objects require non null ( pdb options , " pdb options cannot be null " ) ; objects require non null ( monitor , " monitor cannot be null " ) ; abstract msf msf ; random access file file = new random access file ( filename , " r " ) ; if ( msf 2 0 0 detected ( file ) ) { msf = new msf 2 0 0 ( file , pdb options ) ; } else if ( msf 7 0 0 detected ( file ) ) { msf = new msf 7 0 0 ( file , pdb options ) ; } else { / / must close the file here in cases where msf is created , the msf takes / / responsibility for closing the file file close ( ) ; throw new pdb exception ( " msf format not detected " ) ; } msf deserialize ( monitor ) ; return msf ; }


request containers for resources before calling < code > allocate < code >

public void add container request ( t req ) { client add container request ( req ) ; }


sets the max idle timeout in milliseconds for web socket connections

public synchronized service web socket idle timeout millis ( long timeout millis ) { if ( initialized ) { throw before route mapping exception ( ) ; } if ( is running from servlet ( ) ) { throw new illegal state exception ( " web sockets are only supported in the embedded server " ) ; } web socket idle timeout millis = optional of ( timeout millis ) ; return this ; }


emits pcode to push a value of computational category 1 onto the stack

public void emit push cat 1 value ( string value name ) { varnode [ ] in = new varnode [ 2 ] ; in [ 0 ] = sp varnode ; in [ 1 ] = get constant ( 4 , sp varnode get size ( ) ) ; pcode op op = new pcode op ( op address , seqnum + + , pcode op int sub , in , sp varnode ) ; op list add ( op ) ; in = new varnode [ 3 ] ; in [ 0 ] = def space id ; in [ 1 ] = sp varnode ; in [ 2 ] = find register ( value name ) ; op = new pcode op ( op address , seqnum + + , pcode op store , in ) ; op list add ( op ) ; }


get instantaneous fair share of the queue

public resource get fair share ( ) { if ( custom resources ! = null ) { return resource new instance ( fair share m b value ( ) , ( int ) fair share v cores value ( ) , custom resources get fair share values ( ) ) ; } return resource new instance ( fair share m b value ( ) , ( int ) fair share v cores value ( ) ) ; }


return the cors setting as an array of origins

public static string [ ] cors setting as array ( string cors setting ) { if ( strings is null or empty ( cors setting ) ) { return new string [ 0 ] ; } return arrays as list ( cors setting split ( " , " ) ) stream ( ) map ( string : : trim ) to array ( size - > new string [ size ] ) ; }


default string create token ( final string username ) { return null ; }


override to configure how the requested content type is resolved

protected void configure content type resolver ( requested content type resolver builder builder ) { }


build the result of this aggregation if it is at the " top level " of the aggregation tree if , instead , it is a sub - aggregation of another aggregation then the aggregation that contains it will call { @ link # build aggregations ( long [ ] ) }

public final internal aggregation build top level ( ) throws i o exception { assert parent ( ) = = null ; return build aggregations ( new long [ ] { 0 } ) [ 0 ] ; }


post fakeouterboolean test serialization of outer boolean types

public response entity < boolean > fake outer boolean serialize ( @ api param ( value = " input boolean as post body " ) @ valid @ request body ( required = false ) boolean body ) { return new response entity < > ( http status not implemented ) ; }


this is the filename of the pending file itself used during processing ; it ' s persistent value , if any , is ignored

public string get filename ( ) { return filename ; }


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


number of records processed by this job this value is the number of records sent passed on to the engine i e { @ linkplain # get input record count ( ) } minus records with bad dates or out of order

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


returns a path fragment qualified by the rule name and unique fragment to disambiguate artifacts produced from the source file appearing in multiple rules for example " pkgdirname " - > " pkg & lt ; fragment > ruledirname

public final path fragment get unique directory ( path fragment fragment ) { return analysis utils get unique directory ( get label ( ) , fragment , get configuration ( ) is sibling repository layout ( ) ) ; }


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


get the first unused key value remember 0 is reserved for unknown and 1 for default

private byte get first available key ( ) throws i o exception { byte key = 2 ; for ( ; key < 256 ; key + + ) { d b record record = get calling convention record ( key ) ; if ( record = = null ) { return key ; } } if ( key > = 256 ) { throw new i o exception ( " no more keys available for calling conventions " ) ; } return key ; }


public void stop maintenance ( ) { admin state = null ; }


is this maven 2 1 x or 2 2 x - but not maven 3 x ?

public boolean is maven 2 1 ( launcher launcher ) throws i o exception , interrupted exception { return meets maven req version ( launcher , maven 21 ) ; }


returns the user ' s selection or null if the user has not made a selection note : the the value returned from this method may not match the text in the field in the case that the user has selected a value and then typed some text

public t get selected value ( ) { return selected value ; }


public void visit plain insn ( plain insn insn ) { rop rop = insn get opcode ( ) ; if ( rop get opcode ( ) = = reg ops mark local ) { / * * ignore these they ' re dealt with by * the local variable aware translation visitor * / return ; } if ( rop get opcode ( ) = = reg ops move result pseudo ) { / / these get skipped return ; } source position pos = insn get position ( ) ; dop opcode = rop to dop dop for ( insn ) ; dalv insn di ; switch ( rop get branchingness ( ) ) { case rop branch none : case rop branch return : case rop branch throw : { di = new simple insn ( opcode , pos , get regs ( insn ) ) ; break ; } case rop branch goto : { / * * code in the main translation loop will emit a * goto if necessary ( if the branch isn ' t to the * immediately subsequent block ) * / return ; } case rop branch if : { int target = block get successors ( ) get ( 1 ) ; di = new target insn ( opcode , pos , get regs ( insn ) , addresses get start ( target ) ) ; break ; } default : { throw new runtime exception ( " shouldn ' t happen " ) ; } } add output ( di ) ; }


draws the description text in the bottom right corner of the chart ( per default )

protected void draw description ( canvas c ) { / / check if description should be drawn if ( m description ! = null & & m description is enabled ( ) ) { m p point f position = m description get position ( ) ; m desc paint set typeface ( m description get typeface ( ) ) ; m desc paint set text size ( m description get text size ( ) ) ; m desc paint set color ( m description get text color ( ) ) ; m desc paint set text align ( m description get text align ( ) ) ; float x , y ; / / if no position specified , draw on default position if ( position = = null ) { x = get width ( ) - m view port handler offset right ( ) - m description get x offset ( ) ; y = get height ( ) - m view port handler offset bottom ( ) - m description get y offset ( ) ; } else { x = position x ; y = position y ; } c draw text ( m description get text ( ) , x , y , m desc paint ) ; } }


updates running statistics with a documents field values

public void add ( final string [ ] field names , final double [ ] field vals ) { if ( field names = = null ) { throw new illegal argument exception ( " cannot add statistics without field names " ) ; } else if ( field vals = = null ) { throw new illegal argument exception ( " cannot add statistics without field values " ) ; } else if ( field names length ! = field vals length ) { throw new illegal argument exception ( " number of field values do not match number of field names " ) ; } / / update total , mean , and variance + + doc count ; string field name ; double field value ; double m 1 , m 2 , m 3 , m 4 ; / / moments double d , dn , dn 2 , t 1 ; final hash map < string , double > deltas = new hash map < > ( ) ; for ( int i = 0 ; i < field names length ; + + i ) { field name = field names [ i ] ; field value = field vals [ i ] ; / / update counts counts put ( field name , 1 + ( counts contains key ( field name ) ? counts get ( field name ) : 0 ) ) ; / / update running sum field sum put ( field name , field value + ( field sum contains key ( field name ) ? field sum get ( field name ) : 0 ) ) ; / / update running deltas deltas put ( field name , field value * doc count - field sum get ( field name ) ) ; / / update running mean , variance , skewness , kurtosis if ( means contains key ( field name ) ) { / / update running means m 1 = means get ( field name ) ; d = field value - m 1 ; means put ( field name , m 1 + d / doc count ) ; / / update running variances dn = d / doc count ; t 1 = d * dn * ( doc count - 1 ) ; m 2 = variances get ( field name ) ; variances put ( field name , m 2 + t 1 ) ; m 3 = skewness get ( field name ) ; skewness put ( field name , m 3 + ( t 1 * dn * ( doc count - 2d ) - 3d * dn * m 2 ) ) ; dn 2 = dn * dn ; m 4 = t 1 * dn 2 * ( doc count * doc count - 3d * doc count + 3d ) + 6d * dn 2 * m 2 - 4d * dn * m 3 ; kurtosis put ( field name , kurtosis get ( field name ) + m 4 ) ; } else { means put ( field name , field value ) ; variances put ( field name , 0 0 ) ; skewness put ( field name , 0 0 ) ; kurtosis put ( field name , 0 0 ) ; } } this update covariance ( field names , deltas ) ; }


test will timeout if secure random implementation always returns a constant value

public void test random int ( ) throws exception { os secure random random = get os secure random ( ) ; int rand 1 = random next int ( ) ; int rand 2 = random next int ( ) ; while ( rand 1 = = rand 2 ) { rand 2 = random next int ( ) ; } random close ( ) ; }


allows subtypes to set the value of { @ link # built on } this is used for those implementations where an { @ link abstract build } is made ' built ' without actually running its { @ link # run ( ) } method

protected void set built on str ( string built on ) { this built on = built on ; }


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

public void update user ( @ path param ( " username " ) string username , @ valid user body ) ;


updates the discarded flag of the checkpoint stats after this notification , { @ link # is discarded ( ) } will return < code > true < code >

void notify discarded checkpoint ( ) { discarded = true ; }


returns list of shards that being restore and their status

public immutable open map < shard id , shard restore status > shards ( ) { return this shards ; }


create a url endpoint from a list of u r is

public static endpoint url endpoint ( string api , string protocol type , uri uris ) { return new endpoint ( api , protocol type , uris ) ; }


take { @ link properties } as - is ; convert { @ link map } into { @ code properties }

public void set value ( object value ) { if ( ! ( value instanceof properties ) & & value instanceof map ) { properties props = new properties ( ) ; props put all ( ( map < ? , ? > ) value ) ; super set value ( props ) ; } else { super set value ( value ) ; } }


sets the < code > double < code > property

public format test double ( double double ) { this double = double ; return this ; }


rules are : - it must contain at least two complete records - there must be a minimum number of fields per record ( otherwise files with no commas could be treated as csv ! ) - every record except the last must have the same number of fields the reason the last record is allowed to have fewer fields than the others is that it could have been truncated when the file was sampled

public boolean can create from sample ( list < string > explanation , string sample , double allowed fraction of bad lines ) { string format name ; switch ( ( char ) csv preference get delimiter char ( ) ) { case ' , ' : format name = " csv " ; break ; case ' \ t ' : format name = " tsv " ; break ; default : format name = character get name ( csv preference get delimiter char ( ) ) to lower case ( locale root ) + " delimited values " ; break ; } return delimited file structure finder can create from sample ( explanation , sample , min fields per row , csv preference , format name , allowed fraction of bad lines ) ; }


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


private void assign containers ( fi ca scheduler node node ) { log debug ( " assign containers : " + " node = " + node get r m node ( ) get node address ( ) + " # applications = " + applications size ( ) ) ; / / try to assign containers to applications in fifo order for ( map entry < application id , scheduler application < fifo app attempt > > e : applications entry set ( ) ) { fifo app attempt application = e get value ( ) get current app attempt ( ) ; if ( application = = null ) { continue ; } log debug ( " pre - assign containers " ) ; application show requests ( ) ; synchronized ( application ) { / / check if this resource is on the blacklist if ( scheduler app utils is place blacklisted ( application , node , log ) ) { continue ; } for ( scheduler request key scheduler key : application get scheduler keys ( ) ) { int max containers = get max allocatable containers ( application , scheduler key , node , node type off switch ) ; / / ensure the application needs containers of this priority if ( max containers > 0 ) { int assigned containers = assign containers on node ( node , application , scheduler key ) ; / / do not assign out of order w r t priorities if ( assigned containers = = 0 ) { break ; } } } } log debug ( " post - assign containers " ) ; application show requests ( ) ; / / done if ( resources less than ( resource calculator , get cluster resource ( ) , node get unallocated resource ( ) , minimum allocation ) ) { break ; } } / / update the applications ' headroom to correctly take into / / account the containers assigned in this update for ( scheduler application < fifo app attempt > application : applications values ( ) ) { fifo app attempt attempt = ( fifo app attempt ) application get current app attempt ( ) ; if ( attempt = = null ) { continue ; } update app head room ( attempt ) ; } }


removes a label from the label - to - index mapping

private void remove label ( int old label ) { label to index set ( old label , - 1 ) ; }


public builder < req t , resp t > set request marshaller ( marshaller < req t > request marshaller ) { this request marshaller = request marshaller ; return this ; }


if instantiated from a file , this method must be invoked prior to the factory handing out this instance this will complete the parsing of the old language file and the initialization of this instance

void validate ( ) throws j d o m exception , s a x exception , i o exception { if ( old lang file ! = null & & address factory = = null | | register mgr = = null ) { read old language ( false ) ; } }


updating the conf with federation as long as certain subcluster id

public static void update conf for federation ( configuration conf , string sub cluster id ) { conf set ( yarn configuration rm cluster id , sub cluster id ) ; / * * in a federation setting , we will connect to not just the local cluster rm * but also multiple external r ms the membership information of all the r ms * that are currently participating in federation is available in the * central federation state store so we will : 1 obtain the rm service * addresses from federation state store using the * federation r m failover proxy provider 2 disable traditional ha as that * depends on local configuration lookup for r ms using indexes 3 we will * enable federation failover if traditional ha is enabled so that the * appropriate failover retry policy is initialized * / conf set boolean ( yarn configuration federation enabled , true ) ; conf set class ( yarn configuration client failover proxy provider , federation r m failover proxy provider class , r m failover proxy provider class ) ; if ( h a util is h a enabled ( conf ) ) { conf set boolean ( yarn configuration federation failover enabled , true ) ; conf set boolean ( yarn configuration rm ha enabled , false ) ; } }


find all " tokens " that match the given pattern in this text a token is like a substring , except that it ' s aware of word boundaries for example , while " bc " is a string of " abc " , calling { @ code find tokens } with " bc " as a pattern on string " abc " won ' t match anything this method is convenient for finding keywords that follow a certain syntax from natural text you can then use { @ link markup text sub text # surround with ( string , string ) } to put mark up around such text

public list < markup text sub text > find tokens ( pattern pattern ) { string text = get text ( ) ; matcher m = pattern matcher ( text ) ; list < sub text > r = new array list < > ( ) ; while ( m find ( ) ) { int idx = m start ( ) ; if ( idx > 0 ) { char ch = text char at ( idx - 1 ) ; if ( character is letter ( ch ) | | character is digit ( ch ) ) continue ; / / not at a word boundary } idx = m end ( ) ; if ( idx < text length ( ) ) { char ch = text char at ( idx ) ; if ( character is letter ( ch ) | | character is digit ( ch ) ) continue ; / / not at a word boundary } r add ( create sub text ( m ) ) ; } return r ; }


only support auto load libarmeabi library from patch in some process , you may not want to install tinker and you can load patch dex and library without install tinker !

public static void load arm library ( application like application like , string lib name ) { if ( lib name = = null | | lib name is empty ( ) | | application like = = null ) { throw new tinker runtime exception ( " lib name or context is null ! " ) ; } if ( tinker application helper is tinker enable for native lib ( application like ) ) { if ( tinker application helper load library from tinker ( application like , " lib / armeabi " , lib name ) ) { return ; } } system load library ( lib name ) ; }


same behavior as { @ link type inference util # run type inference ( type inference , call context ) }

type inference util result run type inference ( unresolved call expression unresolved call , list < resolved expression > resolved args ) ;


public static set < string > get string set ( @ non null final string key , final set < string > default value ) { return get string set ( key , default value , get default s p utils ( ) ) ; }


return nicely formatted error message that { @ link label } label that was pointed to by { @ link target } target did not exist , due to { @ link no such thing exception } e

public static string format missing edge ( @ nullable target target , label label , no such thing exception e , @ nullable attribute attr ) { / / instanceof returns false if target is null ( which is exploited here ) if ( target instanceof rule ) { rule rule = ( rule ) target ; if ( is explicit dependency ( rule , label ) ) { return string format ( " % s and referenced by ' % s ' " , e get message ( ) , target get label ( ) ) ; } else { string additional info = " " ; if ( attr ! = null & & ! strings is null or empty ( attr get doc ( ) ) ) { additional info = string format ( " \ n documentation for implicit attribute % s of rules of type % s : \ n % s " , attr get public name ( ) , rule get rule class ( ) , attr get doc ( ) ) ; } / / n b if you see this error message in one of our integration tests during development of / / a change that adds a new implicit dependency when running blaze , maybe you forgot to add / / a new mock target to the integration test ' s setup return string format ( " every rule of type % s implicitly depends upon the target ' % s ' , but " + " this target could not be found because of : % s % s " , rule get rule class ( ) , label , e get message ( ) , additional info ) ; } } else if ( target instanceof input file ) { return e get message ( ) + " ( this is usually caused by a missing package group in the " + " package - level visibility declaration ) " ; } else { if ( target ! = null ) { return string format ( " in target ' % s ' , no such label ' % s ' : % s " , target get label ( ) , label , e get message ( ) ) ; } return e get message ( ) ; } }


returns the enum represented by the { @ code name }

public static virtual type get enum ( string name ) { for ( virtual type type : values ( ) ) { if ( type name equals ( name ) ) { return type ; } } return null ; }


creates mock ec2 endpoint providing the list of started nodes to the describe instances api call

public static void start httpd ( ) throws exception { log dir = create temp dir ( ) ; s s l context ssl context = get s s l context ( ) ; https server = mock http server create https ( new inet socket address ( inet address get loopback address ( ) get host address ( ) , 0 ) , 0 ) ; https server set https configurator ( new https configurator ( ssl context ) ) ; https server create context ( " / subscription / services / hostedservices / myservice " , ( s ) - > { headers headers = s get response headers ( ) ; headers add ( " content - type " , " text / xml ; charset = utf - 8 " ) ; x m l output factory xml output factory = x m l output factory new factory ( ) ; xml output factory set property ( x m l output factory is repairing namespaces , true ) ; string writer out = new string writer ( ) ; x m l stream writer sw ; try { sw = xml output factory create x m l stream writer ( out ) ; sw write start document ( ) ; string namespace = " http : / / schemas microsoft com / windowsazure " ; sw set default namespace ( namespace ) ; sw write start element ( x m l constants default ns prefix , " hosted service " , namespace ) ; { sw write start element ( " deployments " ) ; { path [ ] files = file system utils files ( log dir ) ; for ( int i = 0 ; i < files length ; i + + ) { path resolve = files [ i ] resolve ( " transport ports " ) ; if ( files exists ( resolve ) ) { list < string > addresses = files read all lines ( resolve ) ; collections shuffle ( addresses , random ( ) ) ; string address = addresses get ( 0 ) ; int index of last colon = address last index of ( ' : ' ) ; string host = address substring ( 0 , index of last colon ) ; string port = address substring ( index of last colon + 1 ) ; sw write start element ( " deployment " ) ; { sw write start element ( " name " ) ; sw write characters ( " mydeployment " ) ; sw write end element ( ) ; sw write start element ( " deployment slot " ) ; sw write characters ( deployment slot production name ( ) ) ; sw write end element ( ) ; sw write start element ( " status " ) ; sw write characters ( deployment status running name ( ) ) ; sw write end element ( ) ; sw write start element ( " role instance list " ) ; { sw write start element ( " role instance " ) ; { sw write start element ( " role name " ) ; sw write characters ( uuid random u u i d ( ) to string ( ) ) ; sw write end element ( ) ; sw write start element ( " ip address " ) ; sw write characters ( host ) ; sw write end element ( ) ; sw write start element ( " instance endpoints " ) ; { sw write start element ( " instance endpoint " ) ; { sw write start element ( " name " ) ; sw write characters ( " myendpoint " ) ; sw write end element ( ) ; sw write start element ( " vip " ) ; sw write characters ( host ) ; sw write end element ( ) ; sw write start element ( " public port " ) ; sw write characters ( port ) ; sw write end element ( ) ; } sw write end element ( ) ; } sw write end element ( ) ; } sw write end element ( ) ; } sw write end element ( ) ; } sw write end element ( ) ; } } } sw write end element ( ) ; } sw write end element ( ) ; sw write end document ( ) ; sw flush ( ) ; final byte [ ] response as bytes = out to string ( ) get bytes ( standard charsets utf 8 ) ; s send response headers ( 200 , response as bytes length ) ; output stream response body = s get response body ( ) ; response body write ( response as bytes ) ; response body close ( ) ; } catch ( x m l stream exception e ) { log manager get logger ( azure discovery cluster formation tests class ) error ( " failed serializing xml " , e ) ; throw new runtime exception ( e ) ; } } ) ; https server start ( ) ; }


find the fields constant that matches field id , throwing an exception if it is not found

public static fields find by thrift id or throw ( int field id ) { fields fields = find by thrift id ( field id ) ; if ( fields = = null ) throw new illegal argument exception ( " field " + field id + " doesn ' t exist ! " ) ; return fields ; }


write the record to ` out ` and return its size

public static int write to ( data output stream out , int offset delta , long timestamp delta , byte buffer key , byte buffer value , header [ ] headers ) throws i o exception { int size in bytes = size of body in bytes ( offset delta , timestamp delta , key , value , headers ) ; byte utils write varint ( size in bytes , out ) ; byte attributes = 0 ; / / there are no used record attributes at the moment out write ( attributes ) ; byte utils write varlong ( timestamp delta , out ) ; byte utils write varint ( offset delta , out ) ; if ( key = = null ) { byte utils write varint ( - 1 , out ) ; } else { int key size = key remaining ( ) ; byte utils write varint ( key size , out ) ; utils write to ( out , key , key size ) ; } if ( value = = null ) { byte utils write varint ( - 1 , out ) ; } else { int value size = value remaining ( ) ; byte utils write varint ( value size , out ) ; utils write to ( out , value , value size ) ; } if ( headers = = null ) throw new illegal argument exception ( " headers cannot be null " ) ; byte utils write varint ( headers length , out ) ; for ( header header : headers ) { string header key = header key ( ) ; if ( header key = = null ) throw new illegal argument exception ( " invalid null header key found in headers " ) ; byte [ ] utf 8 bytes = utils utf 8 ( header key ) ; byte utils write varint ( utf 8 bytes length , out ) ; out write ( utf 8 bytes ) ; byte [ ] header value = header value ( ) ; if ( header value = = null ) { byte utils write varint ( - 1 , out ) ; } else { byte utils write varint ( header value length , out ) ; out write ( header value ) ; } } return byte utils size of varint ( size in bytes ) + size in bytes ; }


test serialization of outer number types

public single < big decimal > rx fake outer number serialize ( big decimal body , api client auth info auth info ) { return single create ( new io vertx rx java single on subscribe adapter < > ( fut - > delegate fake outer number serialize ( body , auth info , fut ) ) ) ; }


gets a handle to the system ' s keyvalue state the keyvalue state is only accessible if the function is executed on a keyed stream on each access , the state exposes the value for the key of the element currently processed by the function each function may have multiple partitioned states , addressed with different names because the scope of each value is the key of the currently processed element , and the elements are distributed by the flink runtime , the system can transparently scale out and redistribute the state and keyed stream the following code example shows how to implement a continuous counter that counts how many times elements of a certain key occur , and emits an updated count for that element on each occurrence { @ code data stream < my type > stream = ; keyed stream < my type > keyed stream = stream key by ( " id " ) ; keyed stream map ( new rich map function < my type , tuple 2 < my type , long > > ( ) { private value state < long > count ; public void open ( configuration cfg ) { state = get runtime context ( ) get state ( new value state descriptor < long > ( " count " , long serializer instance , 0l ) ) ; } public tuple 2 < my type , long > map ( my type value ) { long count = state value ( ) + 1 ; state update ( value ) ; return new tuple 2 < > ( value , count ) ; } } ) ; }

< t > value state < t > get state ( value state descriptor < t > state properties ) ;


blocks until permits are available for all the values in { @ code values to acquire } , and then atomically acquires these permits { @ code acquire all ( values to acquire ) } atomically does the following computes { @ code m } , the number of values in { @ code values to acquire } that are not currently in the backing { @ link multiset } adds { @ code values to acquire } to the backing { @ link multiset } blocks until { @ code m } permits are available from the backing { @ link semaphore } acquires these permits

public abstract void acquire all ( set < t > values to acquire ) throws interrupted exception ;


return a q name for the given name , relative to the namespace uri of this factory , if given

protected q name get q name ( string name ) { return ( get namespace uri ( ) ! = null ? new q name ( get namespace uri ( ) , name ) : new q name ( name ) ) ; }


private options get opts ( ) { options opts = new options ( ) ; add plan commands ( opts ) ; add help commands ( opts ) ; add execute commands ( opts ) ; add query commands ( opts ) ; add cancel commands ( opts ) ; add report commands ( opts ) ; return opts ; }


get the real time aggregation operation of this metric

public timeline metric operation get realtime aggregation op ( ) { return realtime aggregation op ; }


list the statuses of the filesdirectories in the given path if the path is a directory

public file status [ ] list status ( final path f ) throws access control exception , file not found exception , unsupported file system exception , i o exception { final path abs f = fix relative part ( f ) ; return new f s link resolver < file status [ ] > ( ) { @ override public file status [ ] next ( final abstract file system fs , final path p ) throws i o exception , unresolved link exception { return fs list status ( p ) ; } } resolve ( file context this , abs f ) ; }


gets a local vector given a world vector note that the same vector 2 instance is returned each time this method is called

public vector 2 get local vector ( vector 2 world vector ) { jni get local vector ( addr , world vector x , world vector y , tmp ) ; local vector x = tmp [ 0 ] ; local vector y = tmp [ 1 ] ; return local vector ; }


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


returns the name of the tools repository


return true iff the tuple is full ( all data sources contain this key )

protected boolean combine ( object [ ] srcs , tuple writable dst ) { assert srcs length = = dst size ( ) ; for ( int i = 0 ; i < srcs length ; + + i ) { if ( ! dst has ( i ) ) { return false ; } } return true ; }


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


private void merge string ids ( ) { table of contents section [ ] sections = new table of contents section [ dexes length ] ; dex section [ ] dex sections = new dex section [ dexes length ] ; int [ ] offsets = new int [ dexes length ] ; int [ ] indexes = new int [ dexes length ] ; / / values contains one value from each dex , sorted for fast retrieval of / / the smallest value the list associated with a value has the indexes / / of the dexes that had that value tree map < string , list < integer > > values = new tree map < string , list < integer > > ( ) ; boolean has value = false ; for ( int i = 0 ; i < dexes length ; i + + ) { sections [ i ] = dexes [ i ] get table of contents ( ) string ids ; dex sections [ i ] = sections [ i ] exists ( ) ? dexes [ i ] open ( sections [ i ] off ) : null ; / / fill in values with the first value of each dex if ( null ! = dex sections [ i ] ) { offsets [ i ] = dex sections [ i ] get position ( ) ; if ( offsets [ i ] > 0 ) { has value = true ; } } / / for ( int j = 0 ; j < sections [ i ] size ; j + + ) { int position = dex sections [ i ] get position ( ) ; int off = dex sections [ i ] read int ( ) ; string value = null ; if ( off < 0 ) { / / , int nex dex off = off * - 1 - 1 ; if ( dexes length > i + 1 & & dexes [ i + 1 ] strings ( ) size ( ) > = nex dex off + 1 ) { value = dexes [ i + 1 ] strings ( ) get ( nex dex off ) ; } else { throw new illegal argument exception ( " the string index : " + nex dex off + " does not existed on next dex ! " ) ; } } else { dex sections [ i ] get data ( ) position ( position ) ; value = dex sections [ i ] read string ( ) ; } list < integer > l = values get ( value ) ; if ( null = = l ) { l = new array list < integer > ( ) ; } l add ( new integer ( i ) ) ; values put ( value , l ) ; } } if ( has value ) { contents out string ids off = ids defs out get position ( ) ; } else { contents out string ids off = 0 ; } int out count = 0 ; while ( ! values is empty ( ) ) { map entry < string , list < integer > > first = values poll first entry ( ) ; for ( integer dex : first get value ( ) ) { index maps [ dex ] string ids [ indexes [ dex ] + + ] = out count ; } contents out string datas size + + ; ids defs out write int ( string data out get position ( ) ) ; string data out write string data ( first get key ( ) ) ; out count + + ; } contents out string ids size = out count ; }


creates a new blocking - style stub that supports unary and streaming output calls on the service

public static xds update health service blocking stub new blocking stub ( io grpc channel channel ) { io grpc stub abstract stub stub factory < xds update health service blocking stub > factory = new io grpc stub abstract stub stub factory < xds update health service blocking stub > ( ) { @ java lang override public xds update health service blocking stub new stub ( io grpc channel channel , io grpc call options call options ) { return new xds update health service blocking stub ( channel , call options ) ; } } ; return xds update health service blocking stub new stub ( factory , channel ) ; }


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

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


private void init worker id ( long worker id ) { if ( worker id = = null ) { worker id = generate worker id ( ) ; } if ( worker id > max worker id | | worker id < 0 ) { string message = string format ( " worker id can ' t be greater than % d or less than 0 " , max worker id ) ; throw new illegal argument exception ( message ) ; } this worker id = worker id < < ( timestamp bits + sequence bits ) ; }


test serialization of outer boolean types

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


get the name of this data that is a component of another data item

public string get field name ( ) { if ( component = = null ) { / / is array ? return " [ " + this index in parent + " ] " ; } string my name = component get field name ( ) ; if ( my name = = null | | my name length ( ) = = 0 ) { my name = component get default field name ( ) ; } return my name ; }


public void ship date test ( ) { / / todo : test ship date }


optionally add some actions to the project owning this build

collection < ? extends action > get project actions ( ) ;


public closeable reference < closeable image > get cached image ( @ nullable cache key cache key ) { memory cache < cache key , closeable image > memory cache = m bitmap memory cache ; if ( memory cache = = null | | cache key = = null ) { return null ; } closeable reference < closeable image > closeable image = memory cache get ( cache key ) ; if ( closeable image ! = null & & ! closeable image get ( ) get quality info ( ) is of full quality ( ) ) { closeable image close ( ) ; return null ; } return closeable image ; }


repeatedly dequeues references from the queue and invokes { @ link finalizable reference # finalize referent ( ) } on them until the queue is empty this method is a no - op if the background thread was created successfully

void clean up ( ) { if ( thread started ) { return ; } reference < ? > reference ; while ( ( reference = queue poll ( ) ) ! = null ) { / * * this is for the benefit of phantom references weak and soft references will have already * been cleared by this point * / reference clear ( ) ; try { ( ( finalizable reference ) reference ) finalize referent ( ) ; } catch ( throwable t ) { logger log ( level severe , " error cleaning up after reference " , t ) ; } } }


tests that when multiple regions are selected , the user is notified via pop - up that this is not acceptable

public void test multiple selection ( ) { / / first set up two selection ranges address range range 1 = new address range impl ( addr ( 0x 0 1 0 0 4 0 6 2 ) , addr ( 0x 0 1 0 0 4 0 6 4 ) ) ; address range range 2 = new address range impl ( addr ( 0x 0 1 0 0 4 0 6c ) , addr ( 0x 0 1 0 0 4 0 6e ) ) ; address set addr set = new address set ( ) ; addr set add ( range 1 ) ; addr set add ( range 2 ) ; / / create an event that we can fire to all subscribers , and send it make selection ( tool , program , addr set ) ; / / now invoke the menu option we want to test perform action ( search mnemonic operands const action , cb get provider ( ) , false ) ; / / here ' s the main assert : if the code recognizes that we have multiple selection , the / / mem search dialog will not be displayed ( an error message pops up instead ) so verify that / / the dialog is null and we ' re ok window error dialog = wait for window ( " mnemonic search error " , 2000 ) ; assert not null ( error dialog ) ; error dialog set visible ( false ) ; }


save to a local file any existing file is overwritten unless the os blocks that

public void save ( file file , t instance ) throws i o exception { write json as bytes ( instance , files new output stream ( file to path ( ) ) ) ; }


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


allows subclasses to change the type of { @ link auto lookup } created by this table

protected auto lookup create auto lookup ( ) { return new g table auto lookup ( this ) ; }


skips over vowels in a string has exceptions for skipping consonants that will not be encoded

int skip vowels ( int at ) { if ( at < 0 ) { return 0 ; } if ( at > = m length ) { return m length ; } char it = char at ( at ) ; while ( is vowel ( it ) | | ( it = = ' w ' ) ) { if ( string at ( at , 4 , " wicz " , " witz " , " wiak " , " " ) | | string at ( ( at - 1 ) , 5 , " ewski " , " ewsky " , " owski " , " owsky " , " " ) | | ( string at ( at , 5 , " wicki " , " wacki " , " " ) & & ( ( at + 4 ) = = m last ) ) ) { break ; } at + + ; if ( ( ( char at ( at - 1 ) = = ' w ' ) & & ( char at ( at ) = = ' h ' ) ) & & ! ( string at ( at , 3 , " hop " , " " ) | | string at ( at , 4 , " hide " , " hard " , " head " , " hawk " , " herd " , " hook " , " hand " , " hole " , " " ) | | string at ( at , 5 , " heart " , " house " , " hound " , " " ) | | string at ( at , 6 , " hammer " , " " ) ) ) { at + + ; } if ( at > ( m length - 1 ) ) { break ; } it = char at ( at ) ; } return at ; }


returns a newly - created { @ code immutable value graph } based on the contents of this { @ code builder }

public immutable value graph < n , v > build ( ) { return immutable value graph copy of ( mutable value graph ) ; }


public void capital camel test ( ) { / / todo : test capital camel }


read operator { @ code list state } from a { @ code savepoint }

public < t > data set < t > read list state ( string uid , string name , type information < t > type info ) throws i o exception { operator state operator state = metadata get operator state ( uid ) ; list state descriptor < t > descriptor = new list state descriptor < > ( name , type info ) ; list state input format < t > input format = new list state input format < > ( operator state , descriptor ) ; return env create input ( input format , type info ) ; }


adds a set of functions to an existing comparison provider

public void compare functions ( set < function > functions , function comparison provider provider ) { if ( functions is empty ( ) | | provider = = null ) { return ; } providers add ( provider ) ; provider set visible ( true ) ; provider get model ( ) compare functions ( functions ) ; }


public static ssl stores create ( string keystore file , string keystore password , string truststore file , string truststore password ) { return new ssl stores ( keystore file , keystore password , null , truststore file , truststore password , false ) ; }


adds the given element to this queue if the queue is currently full , the element at the head of the queue is evicted to make room

public boolean add ( e e ) { check not null ( e ) ; / / check before removing if ( max size = = 0 ) { return true ; } if ( size ( ) = = max size ) { delegate remove ( ) ; } delegate add ( e ) ; return true ; }


get the registry path for an instance under the user ' s home node

public static string registry path for instance ( string instance name ) { return registry utils service path ( registry utils current user ( ) , yarn service constants app type , instance name ) ; }


parses the given { @ link address range } from the given { @ link program } to extract all instructions ; results are stored in the local { @ link instruction metadata } list

public void load ( program program , address range address range ) throws invalid input exception { / / first clear out any current instructions instructions clear ( ) ; / / do some initial checks on the program and addresses we want to load instructions / / for if these are invalid , no need to proceed if ( program = = null | | address range = = null | | address range get length ( ) = = 0 ) { return ; } / / now we have to use the sleigh logger to parse each of the code units in the / / requested address set listing listing = program get listing ( ) ; address set addr set = new address set ( address range ) ; code unit iterator cu iter = listing get code units ( addr set , true ) ; / / do a quick check to see if we have any valid code units in the selection if not , / / display an error message if ( ! cu iter has next ( ) ) { throw new invalid input exception ( " no instructions found in selection " ) ; } task launcher launch modal ( " loading instructions " , monitor - > { sleigh debug logger logger ; monitor set indeterminate ( true ) ; while ( cu iter has next ( ) ) { if ( monitor is cancelled ( ) ) { return ; } code unit cu = cu iter next ( ) ; instruction metadata instruction metadata ; / / if this cu is an instruction , we can use the sleigh debug logger to build the / / mask info if not , we don ' t need to create anything complex for masking - it ' s either / / on or off if ( cu instanceof instruction ) { logger = new sleigh debug logger ( program , cu get address ( ) , sleigh debug mode verbose ) ; if ( logger parse failed ( ) ) { msg show error ( this , null , " parsing error " , " error parsing instruction : " + cu to string ( ) ) ; return ; } instruction metadata = get instruction metadata ( logger , cu ) ; if ( instruction metadata ! = null ) { instructions add ( instruction metadata ) ; } process operands ( logger , cu , instruction metadata ) ; } else if ( cu instanceof data ) { try { instruction metadata = get instruction metadata ( cu ) ; if ( instruction metadata ! = null ) { instructions add ( instruction metadata ) ; } } catch ( invalid input exception e ) { msg show error ( this , null , " parsing error " , " error parsing data : " + cu to string ( ) ) ; return ; } } } } ) ; model changed ( update type reload ) ; }


returns the number of block pending for the given node by adding those blocks in pending rep and out of service node blocks

private int get pending count for node ( datanode descriptor dn ) { int count = 0 ; hash map < block info , integer > blocks = out of service node blocks get ( dn ) ; if ( blocks ! = null ) { count + = blocks size ( ) ; } list < block info > pending blocks = pending rep get ( dn ) ; if ( pending blocks ! = null ) { count + = pending blocks size ( ) ; } return count ; }


processes { @ link # output buffer } by rendering it , skipping it or doing nothing , and returns whether it may be possible to process another output buffer

private boolean process output buffer ( long position us , long elapsed realtime us ) throws exo playback exception , decoder exception { if ( initial position us = = c time unset ) { initial position us = position us ; } long early us = output buffer time us - position us ; if ( ! has output ( ) ) { / / skip frames in sync with playback , so we ' ll be at the right frame if the mode changes if ( is buffer late ( early us ) ) { skip output buffer ( output buffer ) ; return true ; } return false ; } long presentation time us = output buffer time us - output stream offset us ; format format = format queue poll floor ( presentation time us ) ; if ( format ! = null ) { output format = format ; } long elapsed realtime now us = system clock elapsed realtime ( ) * 1000 ; long elapsed since last render us = elapsed realtime now us - last render time us ; boolean is started = get state ( ) = = state started ; boolean should render first frame = ! rendered first frame after enable ? ( is started | | may render first frame after enable if not started ) : ! rendered first frame after reset ; / / todo : we shouldn ' t force render while we are joining an ongoing playback if ( should render first frame | | ( is started & & should force render output buffer ( early us , elapsed since last render us ) ) ) { render output buffer ( output buffer , presentation time us , output format ) ; return true ; } if ( ! is started | | position us = = initial position us ) { return false ; } / / todo : treat dropped buffers as skipped while we are joining an ongoing playback if ( should drop buffers to keyframe ( early us , elapsed realtime us ) & & maybe drop buffers to keyframe ( position us ) ) { return false ; } else if ( should drop output buffer ( early us , elapsed realtime us ) ) { drop output buffer ( output buffer ) ; return true ; } if ( early us < 30000 ) { render output buffer ( output buffer , presentation time us , output format ) ; return true ; } return false ; }


crosses an element over to the opposite heap by moving it one level down ( or up if there are no elements below it ) returns the new position of the element

int cross over ( int index , e x ) { int min child index = find min child ( index ) ; / / todo ( kevinb ) : split the & & into two if ' s and move cross over up so it ' s / / only called when there ' s no child if ( ( min child index > 0 ) & & ( ordering compare ( element data ( min child index ) , x ) < 0 ) ) { queue [ index ] = element data ( min child index ) ; queue [ min child index ] = x ; return min child index ; } return cross over up ( index , x ) ; }


private void enable protocol ( protocol protocol ) { client = client new builder ( ) ssl socket factory ( handshake certificates ssl socket factory ( ) , handshake certificates trust manager ( ) ) hostname verifier ( new recording hostname verifier ( ) ) protocols ( as list ( protocol , protocol http 1 1 ) ) build ( ) ; server use https ( handshake certificates ssl socket factory ( ) , false ) ; server set protocol negotiation enabled ( true ) ; server set protocols ( client protocols ( ) ) ; }